Message89916
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). |
|
Date |
User |
Action |
Args |
2009-06-30 11:08:17 | tim.peters | set | recipients:
+ tim.peters, drj |
2009-06-30 11:08:17 | tim.peters | set | messageid: <1246360097.73.0.995876464759.issue6387@psf.upfronthosting.co.za> |
2009-06-30 11:08:16 | tim.peters | link | issue6387 messages |
2009-06-30 11:08:15 | tim.peters | create | |
|