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

Dylan Dmitri Gray report at bugs.python.org
Wed Mar 7 22:25:22 EST 2018


New submission from Dylan Dmitri Gray <d.dylan.g at gmail.com>:

```
>>> 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 9007199254740991 = 2**53 -1

Probably an internal off by one?

----------
messages: 313420
nosy: ddg
priority: normal
severity: normal
status: open
title: Floating Point Arithmetic Inconsistency (internal off-by-one)
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33022>
_______________________________________


More information about the New-bugs-announce mailing list