Mercurial > cpython-lru_cache-weakref
diff Modules/mathmodule.c @ 31763:3473dea3aa4c legacy-trunk
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.
| author | Hye-Shik Chang <hyeshik@gmail.com> |
|---|---|
| date | Mon, 22 Mar 2004 08:43:55 +0000 |
| parents | b6c139544c16 |
| children | 6fb46e87d5f9 e762fea78cb2 |
line wrap: on
line diff
--- a/Modules/mathmodule.c Mon Mar 22 00:33:28 2004 +0000 +++ b/Modules/mathmodule.c Mon Mar 22 08:43:55 2004 +0000 @@ -57,7 +57,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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
