[Python-checkins] python/dist/src/Modules mathmodule.c,2.73,2.74
perky at users.sourceforge.net
perky at users.sourceforge.net
Mon Mar 22 03:43:57 EST 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19398/Modules
Modified Files:
mathmodule.c
Log Message:
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.
Index: mathmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mathmodule.c,v
retrieving revision 2.73
retrieving revision 2.74
diff -C2 -d -r2.73 -r2.74
*** mathmodule.c 19 Nov 2003 15:24:46 -0000 2.73
--- mathmodule.c 22 Mar 2004 08:43:55 -0000 2.74
***************
*** 58,62 ****
x = (*func)(x);
PyFPE_END_PROTECT(x)
! Py_SET_ERANGE_IF_OVERFLOW(x);
if (errno && is_error(x))
return NULL;
--- 58,62 ----
x = (*func)(x);
PyFPE_END_PROTECT(x)
! Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
***************
*** 75,79 ****
x = (*func)(x, y);
PyFPE_END_PROTECT(x)
! Py_SET_ERANGE_IF_OVERFLOW(x);
if (errno && is_error(x))
return NULL;
--- 75,79 ----
x = (*func)(x, y);
PyFPE_END_PROTECT(x)
! Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
***************
*** 144,148 ****
errno = 0;
x = frexp(x, &i);
! Py_SET_ERANGE_IF_OVERFLOW(x);
if (errno && is_error(x))
return NULL;
--- 144,148 ----
errno = 0;
x = frexp(x, &i);
! Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
***************
*** 169,173 ****
x = ldexp(x, exp);
PyFPE_END_PROTECT(x)
! Py_SET_ERANGE_IF_OVERFLOW(x);
if (errno && is_error(x))
return NULL;
--- 169,173 ----
x = ldexp(x, exp);
PyFPE_END_PROTECT(x)
! Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
***************
*** 187,191 ****
errno = 0;
x = modf(x, &y);
! Py_SET_ERANGE_IF_OVERFLOW(x);
if (errno && is_error(x))
return NULL;
--- 187,191 ----
errno = 0;
x = modf(x, &y);
! Py_SET_ERRNO_ON_MATH_ERROR(x);
if (errno && is_error(x))
return NULL;
More information about the Python-checkins
mailing list