Liangxu Linux
May 24, 2023 · Fundamentals
Why 0.1 + 0.2 Gives 0.30000000000000004 – Inside 64‑bit Floating‑Point Math
This article explains why adding the decimal numbers 0.1 and 0.2 in binary floating‑point arithmetic yields the surprising result 0.30000000000000004, by detailing the exact 64‑bit representations, the rounding‑to‑nearest‑even rule, and step‑by‑step Python calculations that expose the underlying IEEE‑754 mechanics.
IEEE-754PythonRounding
0 likes · 10 min read
