October 2015
Beginner to intermediate
400 pages
14h 44m
English
Go provides two sizes of floating-point numbers, float32 and
float64.
Their arithmetic properties are governed by the IEEE 754 standard
implemented by all modern CPUs.
Values of these numeric types range from tiny to huge.
The limits of floating-point values can be found in the math
package.
The constant math.MaxFloat32, the largest float32, is
about 3.4e38, and math.MaxFloat64 is about 1.8e308.
The smallest
positive values are near 1.4e-45 and 4.9e-324, respectively.
A float32 provides approximately six decimal digits of precision, whereas
a float64 provides about 15 digits; float64 should be preferred for
most purposes because float32 computations accumulate error rapidly unless one is quite careful, and ...