Message105378
Perfect! Applied in r81020.
You're correct that n/10**6 and n/1e6 aren't the same thing, at least for n large enough:
Python 2.7b2+ (trunk:81019:81020, May 9 2010, 10:33:17)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import division
[35402 refs]
>>> (2**53+1)/10**6
9007199254.740993
[35404 refs]
>>> (2**53+1)/1e6
9007199254.740992
[35404 refs]
In the second case, 2**53+1 first gets converted to a float, and then the division is performed, so there are two points at which a rounding error can be introduced. The first case only involves one rounding error. |
|
Date |
User |
Action |
Args |
2010-05-09 09:36:31 | mark.dickinson | set | recipients:
+ mark.dickinson, belopolsky, pitrou |
2010-05-09 09:36:30 | mark.dickinson | set | messageid: <1273397790.96.0.236898696246.issue8644@psf.upfronthosting.co.za> |
2010-05-09 09:36:28 | mark.dickinson | link | issue8644 messages |
2010-05-09 09:36:27 | mark.dickinson | create | |
|