Reputation: 24344
How many x
such that 1 <= x <= 2
have exact representation in single precision floating point number IEEE 754 representation?
Upvotes: 0
Views: 398
Reputation: 26185
There are 8388609. Of those 2^23 are in 1 <= x < 2, all having the same sign and exponent, with 23 bits of fraction. Add one for including 2, which is the same bit pattern as 1 except for adding 1 to the exponent.
Upvotes: 3