Possible Duplicate:
How is floating point stored? When does it matter?
I was wondering what's the reason for the next behavior in Python:
>>> print(0.1 + 0.1 + 0.1 - 0.3)
5.55111512313e-17
To fix that one must use decimal instead:
>>> from decimal import Decimal
>>> Decimal('0.1') + Decimal('0.1') + Decimal('0.1') - Decimal('0.3')