New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test failure in test_math::testSum #47671
Comments
In Py3k, but not in trunk: ====================================================================== Traceback (most recent call last):
File "/home/gbr/devel/python3k/Lib/test/test_math.py", line 769, in
testSum
self.assertEqual(math.sum(vals), s)
OverflowError: math range error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gbr/devel/python3k/Lib/test/test_math.py", line 772, in
testSum
"for math.sum(%.100r)" % (i, s, vals))
AssertionError: test 13 failed: got OverflowError, expected
1.7976931348623157e+308 for math.sum([1.7976931348623157e+308,
9.979201547673598e+291]) System info: linux x86, glibc 2.8 |
Sadly, this is not the only problem with math.sum on x86 hardware right With the current algorithm, behaviour at or near the boundary of the I am intrigued that py3k and the trunk give different results, though; Georg, *only if you have time*, could you please tell me what results >>> 1e16 + 2.9999
10000000000000002.0
>>> 1.7976931348623157e+308 + 9.979201547673598e+291
1.7976931348623157e+308 (The results shown are the ones I get on OS X 10.5.4; I don't have |
Both trunk and 3k give this: >>> 1e16 + 2.9999
10000000000000004.0
>>> 1.7976931348623157e+308 + 9.979201547673598e+291
inf |
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 if 1e16+2.999 != 1e16+2.9999:
return These lines are supposed to bail out of testSum on IEEE 754 hardware 1e16+2.999 to evaluate to 10000000000000002.0 so the condition in the if statement ought to be True, and the rest of It looks like this bailout is working as intended in the trunk, but not |
Strangely, it seems to work now with 3k too -- both in a debug and |
The tests at floating point boundaries should probably be removed and |
See also bpo-5593. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: