A mantissa is the base value in a floating-point representation; the exponent acts as its multiplier. Because finite bits approximate infinitely many real values, the stored mantissa can lose precision. section 3.3
When 1.0001 × 1.0001 is not exact
var n float32 = 1.0001 fmt.Println(n * n) The stored value is approximately 1.000100016593933, so the calculation can print 1.0002 rather than the mathematically expected 1.00020001. The representation uses a sign, exponent, and mantissa; float32 allocates 23 bits to the mantissa. section 3.3
Use the representation’s limits when interpreting floating-point results:
- Treat float32 and float64 values as approximations rather than exact real numbers. section 3.3
- Avoid direct == comparisons when small representation errors matter; compare the difference against an acceptable error. section 3.3


