IEEE 754: special values
Exponents of all zeros and all ones are reserved. They encode zero, denormals, infinity and NaN.
Rules
- Exponent 0, mantissa 0: zero
- Exponent 0, mantissa ≠ 0: denormalised
- Exponent 255, mantissa 0: infinity
- Exponent 255, mantissa ≠ 0: NaN
Your turn
Three problems on this topic. Spaces don’t matter.
- 1 · Special values
- 2
- 3
What does this IEEE 754 bit pattern represent?
0 11111111 10000000000000000000001
Type
Worked example
What does this IEEE 754 bit pattern represent?
0 10000011 10100000000000000000000
Worked solution
- 1Exponent 0 and mantissa 0: zero. Exponent 0, mantissa ≠ 0: denormalised.
- 2Exponent 255 and mantissa 0: infinity. Exponent 255, mantissa ≠ 0: NaN.
Typical mistake: Denormalised numbers have no implicit leading 1.
Common questions
What are denormals for?
They fill the gap around zero and allow gradual underflow.
