Series
How Number Representation Works
From Bits to Floating Point — and Everything in Between
Every number in a program is stored as a finite sequence of bits. This series starts with
the simplest binary integers and builds up through fixed-point, IEEE 754 floating-point,
rounding, precision pitfalls, and arbitrary-precision libraries. By the end, you'll
understand why 0.1 + 0.2 !== 0.3 and what to do about it.
How to read this series: Start from the top. Each article builds on the
representation introduced in the previous one. By the end you'll have a complete mental
model of how computers handle numbers — and where the traps are.
- 001
- 002
- 003
- 004
- 005
Precision & Beyond
What goes wrong with finite-precision arithmetic and what we can do about it.
- 006
- 007
- 008