syntagma
syntagma

Reputation: 24344

Questions regarding IEEE 754 single precision floating point numbers

How many x such that 1 <= x <= 2 have exact representation in single precision floating point number IEEE 754 representation?

Upvotes: 0

Views: 398

Answers (1)

Patricia Shanahan
Patricia Shanahan

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

Related Questions