The format of a single-precision floating-point number as per the IEEE 754 standard is:
| Sign (1bit) | Exponent (8 bits) | Mantissa (23 bits) |
Choose the largest floating-point number among the following options.
Answer
(B)
Explanation
All four have sign bit 0, so compare their values using the exponent bias of 127.
- A: exponent 0111 1111 is 127, so the value is \((2 - 2^{-23}) \times 2^{0}\), just under 2.
- B: exponent 1111 1110 is 254, so the value is \((2 - 2^{-23}) \times 2^{127}\), about \(3.4 \times 10^{38}\).
- C: an all-ones exponent is reserved. With a non-zero mantissa the pattern means NaN (not a number), which has no value to compare.
- D: exponent 127 with a zero mantissa is exactly 1.
B is in fact the largest finite single-precision number, so it is the largest option.
Answer: B