[Python-3000-checkins] r64372 - in python/branches/py3k: Lib/test/ieee754.txt Modules/mathmodule.c
mark.dickinson
python-3000-checkins at python.org
Wed Jun 18 12:04:31 CEST 2008
Author: mark.dickinson
Date: Wed Jun 18 12:04:31 2008
New Revision: 64372
Log:
Quick fix for test_math failures on Solaris 10 buildbot. For future
reference, note that that asin(float('inf')) doesn't seem to return the
expected NaN on this platform.
Modified:
python/branches/py3k/Lib/test/ieee754.txt
python/branches/py3k/Modules/mathmodule.c
Modified: python/branches/py3k/Lib/test/ieee754.txt
==============================================================================
--- python/branches/py3k/Lib/test/ieee754.txt (original)
+++ python/branches/py3k/Lib/test/ieee754.txt Wed Jun 18 12:04:31 2008
@@ -127,31 +127,31 @@
>>> sin(INF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> sin(NINF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> sin(NAN)
nan
>>> cos(INF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> cos(NINF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> cos(NAN)
nan
>>> tan(INF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> tan(NINF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> tan(NAN)
nan
@@ -169,11 +169,11 @@
>>> asin(INF), asin(NINF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> acos(INF), acos(NINF)
Traceback (most recent call last):
...
-ValueError: math domain error (invalid argument)
+ValueError: math domain error
>>> equal(atan(INF), PI/2), equal(atan(NINF), -PI/2)
(True, True)
Modified: python/branches/py3k/Modules/mathmodule.c
==============================================================================
--- python/branches/py3k/Modules/mathmodule.c (original)
+++ python/branches/py3k/Modules/mathmodule.c Wed Jun 18 12:04:31 2008
@@ -181,16 +181,16 @@
PyFPE_END_PROTECT(r);
if (Py_IS_NAN(r) && !Py_IS_NAN(x)) {
PyErr_SetString(PyExc_ValueError,
- "math domain error (invalid argument)");
+ "math domain error"); /* invalid arg */
return NULL;
}
if (Py_IS_INFINITY(r) && Py_IS_FINITE(x)) {
if (can_overflow)
PyErr_SetString(PyExc_OverflowError,
- "math range error (overflow)");
+ "math range error"); /* overflow */
else
PyErr_SetString(PyExc_ValueError,
- "math domain error (singularity)");
+ "math domain error"); /* singularity */
return NULL;
}
if (Py_IS_FINITE(r) && errno && is_error(r))
More information about the Python-3000-checkins
mailing list