[Python-checkins] CVS: python/dist/src/Modules mathmodule.c,2.57,2.58
Tim Peters
python-dev@python.org
Thu, 12 Oct 2000 12:42:05 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24477/python/dist/src/modules
Modified Files:
mathmodule.c
Log Message:
Repaired a comment and asserted a precondition.
Index: mathmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mathmodule.c,v
retrieving revision 2.57
retrieving revision 2.58
diff -C2 -r2.57 -r2.58
*** mathmodule.c 2000/10/12 06:10:25 2.57
--- mathmodule.c 2000/10/12 19:42:00 2.58
***************
*** 19,23 ****
/* RED_FLAG 12-Oct-2000 Tim
! * What CHECK does if errno != 0 and x is a NaN is a platform-dependent crap
* shoot. Most (but not all!) platforms will end up setting errno to ERANGE
* then, but EDOM is probably better.
--- 19,23 ----
/* RED_FLAG 12-Oct-2000 Tim
! * What CHECK does if errno == 0 and x is a NaN is a platform-dependent crap
* shoot. Most (but not all!) platforms will end up setting errno to ERANGE
* then, but EDOM is probably better.
***************
*** 39,42 ****
--- 39,43 ----
{
int result = 1; /* presumption of guilt */
+ assert(errno); /* non-zero errno is a precondition for calling */
if (errno == EDOM)
PyErr_SetString(PyExc_ValueError, "math domain error");