Message93635
The single-argument form of the builtin round function can give
incorrect results for large integers.
>>> x = 5e15+1
>>> x == int(x)
True
>>> x == round(x) # expect True here
False
>>> x
5000000000000001.0
>>> round(x)
5000000000000002.0
>>> int(x)
5000000000000001
This is already fixed in trunk (and in 3.x); the fix needs to be
backported to release26-maint. |
|
Date |
User |
Action |
Args |
2009-10-06 08:38:45 | mark.dickinson | set | recipients:
+ mark.dickinson |
2009-10-06 08:38:45 | mark.dickinson | set | messageid: <1254818325.66.0.811291436482.issue7070@psf.upfronthosting.co.za> |
2009-10-06 08:38:44 | mark.dickinson | link | issue7070 messages |
2009-10-06 08:38:43 | mark.dickinson | create | |
|