Computer Arithmetic
In IEEE 754 single precision, what do bit patterns with an all-ones exponent field (255) represent?
- AThe largest normal number, regardless of the significand
- BInfinity if the significand is zero, NaN if it is nonzero
- CZero, regardless of the significand
Show answer and explanation
Answer: B. Infinity if the significand is zero, NaN if it is nonzero
The maximum exponent value (all ones) is reserved for special values. With an all-zero significand it represents positive or negative infinity according to the sign bit; with a nonzero significand it represents NaN. NaNs are further subdivided by significand value, for instance into kinds that do or do not signal exceptions. The largest normal number has an exponent field of 254, and zero is the pattern with exponent and significand all zero. An exponent field of 0 represents zero and subnormals.
- A. The largest normal number has exponent field 254.
- B. Correct. Zero significand means infinity; nonzero means NaN.
- C. Zero has an all-zero exponent and significand.