Jan-22-2017, 01:53 AM
Quote:instead of getting .3, I'm getting .3000000000004.It's the way floating point arithmetic work,Basic Answers Python doc.
There is a Decimal module.
>>> 0.4 - 0.1 0.30000000000000004 >>> from decimal import Decimal >>> Decimal('0.4') - Decimal('0.1') Decimal('0.3')