IEEE 754 Floating Point

X-Ray: Special Cases

How edge values behave in real computations

+Infinity (+∞)

Result of overflow or division by zero.

0 |11111111 |00000000000000000000000

-Infinity (-∞)

Negative overflow or division by -0.

1 |11111111 |00000000000000000000000

NaN

Undefined results

Quiet NaN (qNaN)

1 |11111111 |1MMMMMMMMMMMMMMMMMMMMMM

Propagates silently

Signaling NaN (sNaN)

1 |11111111 |0MMMMMMMMMMMMMMMMMMMMMM

Raises exception; M ≠ 0

0 / 0 → NaN ; NaN ≠ NaN → true ; NaN < x → false ; NaN > x → false ; x ≠ NaN → true

±0

Two distinct zeros

± |00000000 |00000000000000000000000

1 / +0 → +∞ ; 1 / -0 → -∞
+0 == -0

Subnormal

Near-zero numbers

± |00000000 |MMMMMMMMMMMMMMMMMMMMMMM

Smooth underflow; M ≠ 0

IEEE 754 favors propagation over interruption: computations continue instead of crashing.
logoxeland314
NaN → Breaks ordering, not execution
±0 → Preserves directional information