[issue33022] Floating Point Arithmetic Inconsistency (internal off-by-one)

2018-03-07 Thread Tim Peters
Tim Peters added the comment: What did you expect? The precision of Python ints is limited only by the amount of memory you have, but Python floats are IEEE-754 double precision numbers, and have only 53 bits of precision. 2**53 + 1 simply can't be represented exactly as a

[issue33022] Floating Point Arithmetic Inconsistency (internal off-by-one)

2018-03-07 Thread Dylan Dmitri Gray
New submission from Dylan Dmitri Gray : ``` >>> for i in (1,2,3,1.0,2.0,3.0): print(i, i+9007199254740991) ... 1 9007199254740992 2 9007199254740993 3 9007199254740994 1.0 9007199254740992.0 2.0 9007199254740992.0 # <-- !!! 3.0 9007199254740994.0 ``` Notably