[Solved] fmt.Printf(“%f\n”,x) rounds a Float64 to Float32, but fmt.Println(x) doesn’t

[ad_1]

From the docs:

The default precision for %e, %f and %#g is 6; for %g it is the smallest number of digits necessary to identify the value uniquely.

4

[ad_2]

solved fmt.Printf(“%f\n”,x) rounds a Float64 to Float32, but fmt.Println(x) doesn’t