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 tim.peters
Recipients drj, tim.peters
Date 2009-06-30.11:08:15
SpamBayes Score 4.1387378e-07
Marked as misclassified No
Message-id <1246360097.73.0.995876464759.issue6387@psf.upfronthosting.co.za>
In-reply-to
Content
Do you realize that 2**54-1 isn't exactly representable as a float?  It
requires 54 bits of precision, but the Python float format only has 53
bits available (on all popular boxes).

>>> 2**54-1
18014398509481983L
>>> float(_)  # rounds to closest representable float
18014398509481984.0

In fact, x//y == x//float(y) for only a small subset of integer x and y
values, mostly because only a small subset of integer x and y values are
exactly representable as floats (given that Python integers enjoy
unbounded precision, but floats only retain 53 bits).
History
Date User Action Args
2009-06-30 11:08:17tim.peterssetrecipients: + tim.peters, drj
2009-06-30 11:08:17tim.peterssetmessageid: <1246360097.73.0.995876464759.issue6387@psf.upfronthosting.co.za>
2009-06-30 11:08:16tim.peterslinkissue6387 messages
2009-06-30 11:08:15tim.peterscreate