summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-03-22 08:43:55 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-03-22 08:43:55 (GMT)
commit77d9a3effa21b8987ceac26d67ad676e1c5afb49 (patch)
treef302896991076d2d6b39ea6bd6a790762b40cf5e /Modules/mathmodule.c
parent39a0f044210b82f3352b9824c1f1625c7bdb9f29 (diff)
downloadcpython-77d9a3effa21b8987ceac26d67ad676e1c5afb49.zip
cpython-77d9a3effa21b8987ceac26d67ad676e1c5afb49.tar.gz
cpython-77d9a3effa21b8987ceac26d67ad676e1c5afb49.tar.bz2
Patch #871657: Set EDOM for `nan' return values on FreeBSD and OpenBSD.
This fixes a problem that math.sqrt(-1) doesn't raise math.error.
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r--Modules/mathmodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 48c981a..2605114 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -57,7 +57,7 @@ math_1(PyObject *args, double (*func) (double), char *argsfmt)
PyFPE_START_PROTECT("in math_1", return 0)
x = (*func)(x);
PyFPE_END_PROTECT(x)
- Py_SET_ERANGE_IF_OVERFLOW(x);
+ Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
else
@@ -74,7 +74,7 @@ math_2(PyObject *args, double (*func) (double, double), char *argsfmt)
PyFPE_START_PROTECT("in math_2", return 0)
x = (*func)(x, y);
PyFPE_END_PROTECT(x)
- Py_SET_ERANGE_IF_OVERFLOW(x);
+ Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
else
@@ -143,7 +143,7 @@ math_frexp(PyObject *self, PyObject *args)
return NULL;
errno = 0;
x = frexp(x, &i);
- Py_SET_ERANGE_IF_OVERFLOW(x);
+ Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
else
@@ -168,7 +168,7 @@ math_ldexp(PyObject *self, PyObject *args)
PyFPE_START_PROTECT("ldexp", return 0)
x = ldexp(x, exp);
PyFPE_END_PROTECT(x)
- Py_SET_ERANGE_IF_OVERFLOW(x);
+ Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
else
@@ -186,7 +186,7 @@ math_modf(PyObject *self, PyObject *args)
return NULL;
errno = 0;
x = modf(x, &y);
- Py_SET_ERANGE_IF_OVERFLOW(x);
+ Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
else