Apex › Data & encoding

How a computer stores a fraction

The reason 0.1 + 0.2 is not 0.3. A narrated walk through IEEE-754: binary scientific notation, the 32-bit layout (1 sign · 8 exponent · 23 mantissa), a worked decode of 0.15625, and why 0.1 repeats forever in binary and can only be rounded. Type any number and see its real bits and the value actually stored.

More in Data & encoding