SoDeep IconSoDeep
·
The way 'floating point errors' create tiny discrepancies in digital math

The way 'floating point errors' create tiny discrepancies in digital math

@Nan_Binary · June 29, 2026

Computers are brilliant at logic, but they’re surprisingly rubbish at simple arithmetic. It’s like trying to measure exactly a third of a pint using only half-pint glasses; the math just doesn't fit the containers.

This faff is called a "floating point error." Because machines think in binary, they can’t store decimals like 0.1 perfectly. They’re forced to round off, leaving a tiny bit of "digital lint" behind.

It’s like knitting a jumper and being a millimeter short on every stitch. Eventually, those microscopic gaps add up until your rocket misses the moon or your spreadsheet goes wonky.

Wait, why on earth are they stuck using binary if it's so messy?

It seems like a right old faff, doesn't it? But binary is the ultimate labor-saving device for hardware. Imagine trying to build a light switch with ten different positions for each digit; it would be a nightmare to keep the settings from blurring together.

Instead, we use 'on' or 'off'—the digital equivalent of a tea towel: it’s either clean or it’s in the wash. There’s no confusing middle ground. It’s incredibly reliable, even if it means the machine has to do some awkward mental gymnastics to translate our decimals.

We trade a tiny bit of precision for hardware that doesn't get confused by every speck of dust. It's a sensible compromise, like choosing sturdy wellies over silk slippers for a walk on a pebble beach.

So how do you actually count to ten using only two settings?

It’s all about the position, dear. Imagine a row of beach huts along the promenade. Each has a lamp that’s either lit or dark, but they aren't equal. The first lamp is worth one, the second is worth two, the third is worth four—the value doubles as you move left.

To make the number seven, you simply light the huts for four, two, and one. You aren't trying to paint a '7' on a single door; you're using a whole string of huts to add up to the total.

It’s a bit of a palaver to organize, but once the lamps are set, there’s no mistaking the result. Even in a thick sea mist, you can clearly see which huts are glowing and which are dark.

But what if the number you're counting isn't a nice, round whole one?

That’s where the real palaver begins, darling. To handle decimals, we imagine a line in the sand. Everything to the left is our doubling huts, but everything to the right starts halving—one-half, one-quarter, one-eighth.

It’s like paying for an ice cream with coins that only come in halves. If the price doesn't fit those specific slices, you'll be there forever. Since the machine runs out of huts, it just gives up and rounds off.

That tiny bit of leftover 'change' is the arithmetic crumbs. We trade perfect precision for the speed of our glowing lamps.

Should I be worried that my bank balance is just a rough guess?

Good heavens, no! If the bank used those slippery decimals, your life savings would leak away like dry sand through a wicker basket. We’d all be penniless by tea time.

For money, we simply stop using fractions. Instead of storing 'one pound' as a decimal, the computer counts 'one hundred pennies.' It’s much easier to count whole marbles in a jar than to measure splashes of sea water.

By sticking to whole numbers, we keep every penny accounted for. We only tolerate that rounding faff for science or video games where a tiny smudge won't ruin the day.

Explore in card mode →

Related topics

The way 'edge cases' disrupt a computer's logical instructionsThe way 'state machines' track the progress of a digital taskThe logic of 'unit testing' in a complex knitting patternThe way 'daisy chaining' connects multiple digital devices in a seriesThe way 'user permissions' control access to digital filesThe way 'idempotency' ensures a digital command only happens once