This is pretty easy to verify by just knowing how 32 bit floats are represented.
A 32-bit float is represented as:
- 1 bit = sign bit
- 8 bits = exponent; represents a signed value in [-128, 127]. Note that an exponent value 127 is special and reserved for infinity.
- 23 bits = mantissa
Numbers >= 1.0 ==> (sign = 1, 0 <= exponent <= 126, mantissa >=0). That's (2^23 * 127) + 1 (to include infinity). This comes out to exactly 1,065,353,217 for numbers in the range [1.0, +inf].
Numbers < 1.0 and > 0 ==> (sign = 1, exponent < 0, mantissa >= 0). That is 2^23 * 128 = 2^30. This comes out to exactly 1,073,741,824 for numbers in the range (0.0, 1.0).