summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-10-12 19:42:00 (GMT)
committerTim Peters <tim.peters@gmail.com>2000-10-12 19:42:00 (GMT)
commit2bf405ad559a346577cc6b922fd45377c935fafb (patch)
treee66eb926de0bd58515b92b61c9464857806920a4 /Modules
parent20d529be264abd2aa162fc647641b52dbb117656 (diff)
downloadcpython-2bf405ad559a346577cc6b922fd45377c935fafb.zip
cpython-2bf405ad559a346577cc6b922fd45377c935fafb.tar.gz
cpython-2bf405ad559a346577cc6b922fd45377c935fafb.tar.bz2
Repaired a comment and asserted a precondition.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mathmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 09f7135..8c86c38 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -18,7 +18,7 @@ extern double modf (double, double *);
#endif
/* RED_FLAG 12-Oct-2000 Tim
- * What CHECK does if errno != 0 and x is a NaN is a platform-dependent crap
+ * 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.
*/
@@ -38,6 +38,7 @@ static int
is_error(double x)
{
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");
else if (errno == ERANGE) {