New submission from Damien Miller <[EMAIL PROTECTED]>: Hi,
On OpenBSD 4.4, the test_math.py regression test fails with the following: Traceback (most recent call last): File "Lib/test/test_math.py", line 419, in testLog self.assertRaises(ValueError, math.log, NINF) AssertionError: ValueError not raised This is because libm's log function does not return NaN when passed -INFINITY. It returns -INFINITY and sets EDOM. This behaviour seems to be permitted by the C99 spec (ISO/IEC 9899:1999): > 7.12.1 Treatment of error conditions > paragraph2: > ... On a domain error, the function returns an implementation-defined > value; if the integer expression math_errhandling & MATH_ERRNO is > nonzero, the integer expression errno acquires the value EDOM; in mathmodule.c:math_1() errno seems to be deliberately ignored when the result is infinite. The attached patch modified math_1() to retain EDOM errors for infinite results. ---------- components: Library (Lib) files: patch-Modules_mathmodule_c messages: 71963 nosy: djmdjm severity: normal status: open title: test_math: math.log(-ninf) fails to raise exception on OpenBSD versions: Python 2.6 Added file: http://bugs.python.org/file11258/patch-Modules_mathmodule_c _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3682> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com