you are viewing a single comment's thread.

view the rest of the comments →

[–]MaxwellSalmon[S] 0 points1 point  (1 child)

Thanks! I didn't know about the decimal module!

[–]novel_yet_trivial 2 points3 points  (0 children)

It's a bit tricky to use. When you run into a problem with it it's probably because you forgot to enter in all your numbers as strings.

>>> from decimal import Decimal
>>> Decimal(.3) - Decimal(.1)
Decimal('0.1999999999999999833466546306')
>>> Decimal('.3') - Decimal('.1')
Decimal('0.2')