An old-fashioned electric typewriter on a desk, with a piece of paper coming out of it showing faces and animals made out of typed characters.

Tagged: math

There is 1 post tagged "math."

Home - Resume - Projects - BlogRSS Feed

A clunky old adding machine.

The Double Life of Floating Point

Thursday, January 2nd, 2025

Computers are bad at math. If you go into your friendly local Python terminal or JavaScript console, and type “0.1 + 0.1 + 0.1”, it will produce a number that is almost, but not quite 0.3. When you try to write programs that do math, things like this often happen. You may have heard that it’s because the number is “floating point.”

There’s a lot of superstition and folklore around floating-point numbers in computer science, plausibly due to occult-sounding terms like “mantissa” and “significand.” “Floating-point math is imprecise,” people will say. But the “floating-point” part gets way too much emphasis. “Math is too precise” is a better way to put it. The poor floating-point number is just chronically misunderstood.

Read More right-pointing flowery thing

Tagged as computers, math, low-effort titles.