[issue3421] Test failure in test_math::testSum

Mark Dickinson report at bugs.python.org
Sat Jul 26 16:14:57 CEST 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

Thanks.  Those are the results I'd expect on x86.  So here's the puzzle:

On lines 658-9 of Lib/test/test_math.py, in revision 65248 of the py3k 
branch, there's a pair of lines that looks like:

        if 1e16+2.999 != 1e16+2.9999:
            return

These lines are supposed to bail out of testSum on IEEE 754 hardware 
that doesn't do correct rounding.  So on your machine, I'd expect:

1e16+2.999  to evaluate to 10000000000000002.0
1e16+2.9999 to evaluate to 10000000000000004.0

so the condition in the if statement ought to be True, and the rest of 
the tests should be skipped.

It looks like this bailout is working as intended in the trunk, but not 
in Py3k.  Any ideas why there's a difference?  Is there some sort of 
constant folding going on in py3k but not in the trunk?

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3421>
_______________________________________


More information about the Python-bugs-list mailing list