Floating-point representation
IEEE 754: exact stored decimals, direct rounding and neighbors
A displayed decimal can be much shorter than the number stored in binary. Inspect the actual bits and exact decimal before deciding whether a value is equal or merely looks equal.
Content updated: · Maintainer and corrections
Separate the three fields
Binary32 has 1 sign bit, 8 exponent bits and 23 fraction bits; binary64 has 1, 11 and 52. Normal values use an implicit leading one and exponent biases of 127 or 1023. Subnormal values have exponent field zero and no implicit one, allowing gradual underflow.
All-one exponent fields represent Infinity when the fraction is zero and NaN otherwise. Raw Hex and bit input preserve the NaN payload. Decimal NaN creates a fixed quiet NaN, not an arbitrary payload. Hex input is the stored bit pattern in most-significant-digit order, not hexadecimal floating-point notation or a host-endian byte dump.
Round directly to the selected width
This tool parses decimal digits into an exact BigInt fraction and rounds once, to nearest with ties to even. It does not convert decimal through JavaScript Number before producing binary32. That avoids double rounding near a float32 midpoint.
For binary32, 1.000000059604644775390625 is exactly the midpoint between 1 and the next larger value; ties-to-even chooses 3f800000. Increasing the last decimal digit to 1.000000059604644775390626 must choose 3f800001. A decimal-to-Number-to-float32 path can lose that distinction. Decimal input is bounded to 4096 digits, exponent ±5000 and 4110 total characters.
Read exact values and neighbors deliberately
Binary32 0.1 stores exactly 0.100000001490116119384765625. The exact stored decimal is derived from the integer significand and power of two; the separately labeled JavaScript display is a convenient shorter string, not proof of exact decimal equality.
+0 and -0 have different sign bits. Next up from either zero is the smallest positive subnormal; next down is the smallest negative subnormal. NaN has no ordered neighbor. Infinity stays itself toward the infinite side, and its other neighbor is the largest finite value. Neighbor buttons use exact Hex to avoid introducing a new rounding step. This inspector is not arbitrary-precision arithmetic, a numerical stability analysis or an exception-flag emulator.
Data provenance