Float64 microscope
Every JavaScript number is an IEEE-754 binary64: 1 sign bit, 11 exponent bits, 52 mantissa bits. Paste a value, see the bits, step through representable neighbors, and watch why 0.1 + 0.2 lands one ulp past 0.3.
- value
- 0.30000000000000004
- category
- normal
- sign
- 0 (+)
- raw exp
- 1021 / 2047
- unbiased
- -2
- mantissa
- 900719925474100
- ulp
- 5.551e-17
The same bits, laid out byte by byte. IEEE logical order reads left-to-right from sign bit to mantissa tail. Your CPU (if x86 or ARM) stores it reversed.
Both sides round to different binary64 values. The sum of 0.1 and 0.2 overshoots 0.3 by exactly one ulp, which is the minimum possible gap at this magnitude. This is not a bug; it is what "base-2 float" means.
Decoded with Float64Array + BigUint64Array via a shared ArrayBuffer. Prev/next walk by ±1 on the raw bit integer, which is the IEEE-754 "next representable" operation.
Paste a float, see sign / exponent / mantissa bits, the nearest representable value, ulp distance, round-trip through decimal. Walk through catastrophic cancellation, subnormals, and NaN payloads.
← back to lab