Duplicates:
How is floating point stored? When does it matter?
Why does the following occur in the Python Interpreter?
>>> 0.1+0.1+0.1-0.3
5.551115123125783e-17
>>> 0.1+0.1
0.2
>>> 0.2+0.1
0.30000000000000004
>>> 0.3-0.3
0.0
>>> 0.2+0.1
0.30000000000000004
>>>
Why doesn't 0.2 + 0.1 = 0.3
?