[issue4310] Comparison of two ints returns wrong result

Kyle Brandt report at bugs.python.org
Wed Nov 12 22:07:26 CET 2008

New submission from Kyle Brandt <kyle at kbrandt.com>:

The attached program returns a false result on one of my computers with
a Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz processor.  Is seems the
comparison of two int does not perform correctly.  I have python 2.5.2
and  2.6.27-7-generic kernel.

The lines of interest are 89-71:

print type(f_p),type(largest),f_p,largest
if f_p > largest:
     print 'foo'
     largest = f_p

When running this code:
# python id_11-2.py | grep 70600 
<type 'int'> <type 'int'> 70600674 51267216
# python id_11-2.py | grep foo #doesn't return anything

When I run the same code on another machine the end result of the
program is 70600674, whereas my current machine the end result is

files: id_11-2.py
messages: 75794
nosy: kbrandt
severity: normal
status: open
title: Comparison of two ints returns wrong result
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file11996/id_11-2.py

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list