Floating-point Numbers Aren't Real Floating-point numbers are
not "real numbers" in the mathematical sense, even though they
are called "real" in some programming languages. Real numbers
have infinite precision and are therefore continuous and non-
lossy; floating-point numbers have fixed precision and resemble
"badly-behaved" integers, because they're not evenly spaced
throughout their range, and they have a limited range. To
illustrate, assign 2147483647 (the largest signed 32-bit
integer) to a 32-bit float<code> variable (<code>x, say), and
print it. You'll see 2147483648. Now print x - 64. Still
2147483648. Now print x-65 and you'll get 2147483520! Why?
Because the spacing between adjacent floats in that range is
128, and floating-point operations round to the nearest
floating-point number. IEEE floating-point numbers are fixed-
precision numbers based on base-two scientific notation:
1.d1d2...dp-1 × 2e. p is the precision (24 for float, 53 for
double). The spacing between two consecutive numbers is 21-p+e,