This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients belopolsky, mark.dickinson, pitrou
Date 2010-05-09.09:36:27
SpamBayes Score 2.536384e-06
Marked as misclassified No
Message-id <1273397790.96.0.236898696246.issue8644@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-05-09 09:36:31mark.dickinsonsetrecipients: + mark.dickinson, belopolsky, pitrou
2010-05-09 09:36:30mark.dickinsonsetmessageid: <1273397790.96.0.236898696246.issue8644@psf.upfronthosting.co.za>
2010-05-09 09:36:28mark.dickinsonlinkissue8644 messages
2010-05-09 09:36:27mark.dickinsoncreate