New submission from Petr Pisl <petrp...@gmail.com>:

When python compares float and int created from the same int number should be 
equal like 

int(1) == float(1)

but from 9007199254740993 this is not true. 

int(9007199254740993) == float(9007199254740993) is not true. The same behavior 
is for bigger odd numbers. The even numbers are still equal. So it looks like:

int(9007199254740989) == float(9007199254740989) # True
int(9007199254740990) == float(9007199254740990) # True
int(9007199254740991) == float(9007199254740991) # True
int(9007199254740992) == float(9007199254740992) # True
int(9007199254740993) == float(9007199254740993) # False
int(9007199254740994) == float(9007199254740994) # True
int(9007199254740995) == float(9007199254740995) # False
int(9007199254740996) == float(9007199254740996) # True
int(9007199254740997) == float(9007199254740997) # False
int(9007199254740998) == float(9007199254740998) # True

----------
messages: 360571
nosy: Petr Pisl
priority: normal
severity: normal
status: open
title: Strange behavior of comparing int and float numbers
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39436>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to