IEEE 754 Analyzer
Visualize how the computer stores real numbers. This analyzer breaks down 32-bit single precision floats into sign, exponent, and mantissa components.
The Paradox of Digital Decimals
Unlike integers, real numbers (floats) cannot be represented exactly in binary because they can have infinite precision. The IEEE 754 standard solves this by using a form of scientific notation in binary: Value = (-1)^S * 2^(E-127) * 1.M.
This method provides a massive range of values but introduces subtle rounding errors that are the bane of every software developer.
The 0.1 + 0.2 Trap
In base-10, 0.1 is a simple fraction. But in base-2, it's a repeating decimal (like 1/3 in decimal). Because memory is finite, the computer must truncate this sequence.
0.30000000000000004
Special IEEE 754 States
NaN (Not a Number)
Result of undefined operations like 0/0. Represented by an exponent of all 1s and a non-zero mantissa.
Infinity (∞)
Represented by an exponent of all 1s and a zero mantissa. Can be positive or negative.
Denormal Numbers
Used to represent values extremely close to zero where the leading '1' of the mantissa is no longer assumed.
Memory Storage Breakdown
Determines the positive or negative polarity of the value.
The power to which 2 is raised, shifted by a bias of 127.
The fractional part of the number, providing approximately 7 decimal digits of precision.