[Jeff Epler] > Oh -- there are some floats f for which > float(long(f)) > raises an OverflowError in float()? No, at least not unless the machine has very strange arithmetic. For an IEEE box, >>> from math import ldexp >>> b = 2**53 - 1 # string of 53 1-bits >>> ldexp(b, 1024-53) # largest finite IEEE double 1.7976931348623157e+308 >>> long(_) # as a long 179769313486231570814527423731704356798070567525844996598917476803157 260780028538760589558632766878171540458953514382464234321326889464182 768467546703537516986049910576551282076245490090389328944075868508455 133942304583236903222948165808559332123348274797826204144723168738177 180919299881250404026184124858368L >>> float(_) # and back to float 1.7976931348623157e+308 >>> Similarly for its negation, and those are the worst cases.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4