Standard library / math/big
big.NewFloat()
Creates a 53-bit Float from a float64, rounding to nearest even; NaN panics. Expected stdout: '1.25\n'.
Formal Syntax & Structure
go syntaxgo
func NewFloat(x float64) *FloatParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
Return Value
*Float
Creates a 53-bit Float from a float64, rounding to nearest even; NaN panics.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(big.NewFloat(1.25))}