Message194060
This is actually expected because that is just how floating point works in programming (see http://en.wikipedia.org/wiki/Floating_point for all the gnarly details).
If you want exact decimal arithmetic, use the decimal module (which got significantly faster in Python 3.3)::
>>> import decimal
>>> decimal.Decimal('.3') - decimal.Decimal('.1')
Decimal('0.2')
>>> decimal.Decimal('.05') + decimal.Decimal('.01')
Decimal('0.06') |
|
Date |
User |
Action |
Args |
2013-08-01 12:48:52 | brett.cannon | set | recipients:
+ brett.cannon, Laurent.Fournier |
2013-08-01 12:48:51 | brett.cannon | set | messageid: <1375361331.99.0.801693019965.issue18613@psf.upfronthosting.co.za> |
2013-08-01 12:48:51 | brett.cannon | link | issue18613 messages |
2013-08-01 12:48:51 | brett.cannon | create | |
|