Message71963
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. |
|
Date |
User |
Action |
Args |
2008-08-26 00:03:50 | djmdjm | set | recipients:
+ djmdjm |
2008-08-26 00:03:48 | djmdjm | set | messageid: <1219709028.38.0.6245780787.issue3682@psf.upfronthosting.co.za> |
2008-08-26 00:03:46 | djmdjm | link | issue3682 messages |
2008-08-26 00:03:43 | djmdjm | create | |
|