Lesson 010

Floating Point Representation

IEEE 754 · sign · exponent · mantissa

1:00

How IEEE 754 encodes real numbers in binary using three fields — sign, exponent, and mantissa — and why this makes 0.1 + 0.2 not equal 0.3.

By the end, you can

  • Name the three IEEE 754 fields and state the bit widths for single and double precision.
  • Apply the value formula (−1)^S × 1.M × 2^(E−127) to decode a float.
  • Explain the exponent bias and compute the biased exponent for a given power of 2.
  • Explain the implicit leading 1 and state how many effective bits of precision it provides.
  • Encode a simple power-of-two fraction (such as 0.15625) step by step.
  • Explain why 0.1 + 0.2 does not equal 0.3 in IEEE 754.
  • Identify the special bit patterns for ±0, ±Infinity, NaN, and subnormals.
  • List the main floating-point pitfalls: equality testing, money, and precision relative to magnitude.
Up next in Binary & Data Representation
Questions or feedback?