CalcBoard / Why Calculators Say 0.30000000000000004

Why 0.1 + 0.2 Isn't 0.3 on Your Calculator

If you've ever seen 0.30000000000000004 — in a calculator app, a spreadsheet, or a programming console — you've met binary floating point. Here's what's happening, in plain language, and how calculators avoid it.

Download CalcBoard Free

The short version

Most software stores numbers in binary floating point (the IEEE 754 standard). Binary can represent 0.5, 0.25, and 0.125 exactly — powers of two — but not 0.1, 0.2, or 0.3. Those become the nearest binary fraction, which is very close but not equal. Add two of these near-misses and the error peeks out: 0.1 + 0.2 = 0.30000000000000004.

It's not a bug in your device. It's the number system. Try 0.1 + 0.2 in a browser's JavaScript console and you'll see it raw.

Why you usually don't see it

Calculators and spreadsheets round their display to fewer digits than they compute, so the error hides. That works until it doesn't: repeated additions accumulate error, comparisons like “does the total equal 0.3?” fail mysteriously, and money math drifts by a cent. Displays that round are cosmetic; the underlying number is still wrong.

The fix: decimal arithmetic

The robust solution is to compute in base ten — decimal arithmetic — where 0.1, 0.2, and 0.3 are exact by construction. This is how financial systems, and a minority of calculator apps, do their math. The trade-off is speed, which mattered in 1985 and doesn't for a calculator today.

CalcBoard is built this way: every addition, subtraction, multiplication, division, power, and unit conversion runs on exact decimal numbers, so 0.1 + 0.2 is exactly 0.3 and a column of prices sums to the cent. (Honest fine print: transcendental functions like sine and log are irrational and can't be “exact” in any base — CalcBoard computes those to 15 significant digits, the same class of precision as dedicated scientific calculators.)

How to test any calculator

  1. Compute 0.1 + 0.2 − 0.3. Exact decimal gives 0; floating point gives something like 5.5e-17 (or hides it via display rounding).
  2. Sum 0.1 ten times. You should get exactly 1.
  3. Try 1.03 − 0.42. Floating point yields 0.6100000000000001.

Frequently Asked Questions

Is 0.30000000000000004 a bug in my phone?
No — it's the defined behavior of IEEE 754 binary floating point, the number format most software uses. 0.1 and 0.2 have no exact binary representation, so their sum is off by a tiny amount that sometimes becomes visible.
Do all calculator apps have this problem?
No. Apps that use decimal (base-ten) arithmetic — including CalcBoard — represent 0.1, 0.2, and 0.3 exactly, so the error never exists in the first place. Many other apps compute in floating point and round the display to hide it.
Does exact decimal arithmetic matter for everyday use?
For a single quick sum, rarely. It matters when errors accumulate (long chains of operations), when you compare results for equality, and any time money is involved — a ledger that's off by a cent is off.

Use a calculator that gets 0.3 right

CalcBoard computes in exact decimal — free download, no ads.

Download Free on App Store