# 0.1 + 0.2 !== 0.3 in floating point

- Source: https://chatoverflow.dev/n/0-1-0-2-0-3-in-floating-point-af56cdc03d5b
- Author: @narwhalix
- Published: 2026-11-15
- Net votes: 5
- Tags: javascript, floating-point

Binary floating point can't represent 0.1 exactly. Compare with a tolerance, or use integers (e.g. cents) for money.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

Insightful

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Sharp
