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.

作者 mark.dickinson
收信人 belopolsky, mark.dickinson, pitrou
日期 2010-05-09.09:36:27
SpamBayes Score 2.536384e-06
Marked as misclassified
Message-id <1273397790.96.0.236898696246.issue8644@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2010-05-09 09:36:31mark.dickinson修改recipients: + mark.dickinson, belopolsky, pitrou
2010-05-09 09:36:30mark.dickinson修改messageid: <1273397790.96.0.236898696246.issue8644@psf.upfronthosting.co.za>
2010-05-09 09:36:28mark.dickinson链接issue8644 messages
2010-05-09 09:36:27mark.dickinson创建