Idea · Oct 6, 2026
Nearest Representable
A playful IEEE-754 explorer where you type any number, watch it snap to the nearest float on a zoomable number line, and play short 'float golf' puzzles about why 0.1 + 0.2 misbehaves.
What it would do
Inspired by recent Show HN interactive explainers (how browsers work, a 2D/3D walk through GPT-2's internals), this is a single-page explorable for the most misunderstood number format in computing. Type a decimal and the page shows the sign, exponent and mantissa bits for float16, float32 and float64 side by side, the exact decimal value actually stored, and the error. A zoomable number line draws the representable neighbors as tick marks, so students can see the gaps double at every power of two and vanish into subnormals near zero. Bits are clickable: flip one and the value updates live. A 'float golf' mode serves short puzzles (find a number where x + 1 == x, make a loop that never terminates, sum a list in two orders and get two answers) with a timer and shareable results.
Key features
- Live bit-level view for float16, float32 and float64 with click-to-flip bits
- Exact stored decimal value and absolute/relative error, computed with BigInt arithmetic
- Zoomable number line showing representable neighbors, ULP gaps and the subnormal region
- Expression sandbox that evaluates step by step and shows rounding at each operation
- 'Float golf' puzzle mode with shareable URL-encoded results