Take a float apart into sign, exponent and mantissa, and see the exact decimal those bits represent rather than the rounded one languages print.
Not stored exactly
You typed 0.1. The nearest double is 0.1000000000000000055511151231257827021181583404541015625, which is what is stored. Every arithmetic result from here carries that difference.
Exact value
0.1000000000000000055511151231257827021181583404541015625(-1)^0 x 1.1001100110011001100110011001100110011001100110011010 x 2^-4
Exact value
0.100000001490116119384765625(-1)^0 x 1.10011001100110011001101 x 2^-4
The exact value needs 55 decimal places. A binary fraction always terminates in decimal — the denominator is a power of two — but it can take a great many digits to write out, and the short form printed by every language hides all of them.
Stored as a 32-bit float this becomes 0.10000000149011612, a different number. Narrowing a double to a float is a lossy conversion that no compiler will warn you about if you ask for it.
prints as 0.30000000000000004In decimal, the answer is 0.3. Neither operand is stored exactly and their sum is not a double either, so it is rounded a third time — and lands on a different double from the one 0.3 names. Comparing with === then fails even though nothing went wrong.
64-bit double
Also called double, float64, binary64, C `double`, Java `double`, and every JavaScript number.
32-bit single
Also called float, float32, binary32, C `float`, Java `float`, GPU and ML `fp32`.
IEEE 754 Inspector runs entirely on your device — the exact decimal is computed in the page with big-integer arithmetic, so nothing is rounded on the way.
You’re on the Free plan. Compare plans
The exact decimal is the reason this exists. Almost every float inspector shows the sign, exponent and mantissa and then prints the value back with `toString()` — which gives the shortest decimal that round-trips, not the value the bits hold. So you type 0.1, it tells you the bits mean 0.1, and you have learned nothing.
The bits mean 0.1000000000000000055511151231257827021181583404541015625, exactly. Every binary float has such a finite decimal expansion, because the denominator is always a power of two — dividing by 2^k is multiplying by 5^k and moving the point. It is computed here in big-integer arithmetic, so there is no rounding anywhere in the conversion.
That one number explains the whole genre of floating point surprises: why 0.1 + 0.2 is not 0.3, why a running total of a hundred prices is a penny out, and why money belongs in integers. The addition panel shows all three exact values side by side, which is the answer most explanations stop short of giving.
The special values get their own explanations because each has a trap. NaN is not equal to itself, which is why `x !== x` is the portable test and why one NaN poisons every total after it. Negative zero compares equal to zero but `1 / -0` is negative infinity and `Object.is(-0, 0)` is false. Subnormals trade precision away one bit at a time, and arithmetic on them is dramatically slower on some hardware.
Both directions, because both questions get asked: a value in, to see its bits; or a bit pattern in, to see what value it really is.
Because one tenth is not a sum of powers of two, so it has no exact representation in binary. The nearest double is 0.1000000000000000055511151231257827021181583404541015625, and that is the number your arithmetic actually uses.
Because a binary fraction always terminates in decimal but can take a great many digits to write out. The denominator is a power of two, and 10^k = 2^k × 5^k, so the expansion is finite — just long. Every language's shortest-round-trip printing hides all of it.
Three roundings. Neither operand is stored exactly, their exact sum is not a double either so it is rounded again, and the result lands on a different double from the one 0.3 names. The addition panel shows all three values exactly.
A value below the smallest normal float. The exponent field is zero, so there is no implicit leading 1 and the value has fewer significant bits than usual — it fills the gap between the smallest normal value and zero. On some hardware arithmetic on these is far slower, which is why numerical code sometimes flushes them to zero.
No. Store minor units as integers, or use a decimal type. The exact values on this page are the reason: a price that looks like 0.10 is not, and a hundred of them do not add up to 10.