Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 66695:8cabcf4f9033
Remove some unecessary '#ifdef Py_NAN's from floatobject.c
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Sat, 04 Dec 2010 11:52:58 +0000 |
| parents | 7b6af56ee74d |
| children | 573a67276217 |
line wrap: on
line diff
--- a/Objects/floatobject.c Sat Dec 04 11:48:11 2010 +0000 +++ b/Objects/floatobject.c Sat Dec 04 11:52:58 2010 +0000 @@ -575,13 +575,11 @@ double a,b; CONVERT_TO_DOUBLE(v, a); CONVERT_TO_DOUBLE(w, b); -#ifdef Py_NAN if (b == 0.0) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL; } -#endif PyFPE_START_PROTECT("divide", return 0) a = a / b; PyFPE_END_PROTECT(a) @@ -595,13 +593,11 @@ double mod; CONVERT_TO_DOUBLE(v, vx); CONVERT_TO_DOUBLE(w, wx); -#ifdef Py_NAN if (wx == 0.0) { PyErr_SetString(PyExc_ZeroDivisionError, "float modulo"); return NULL; } -#endif PyFPE_START_PROTECT("modulo", return 0) mod = fmod(vx, wx); /* note: checking mod*wx < 0 is incorrect -- underflows to @@ -1492,13 +1488,11 @@ "Cannot pass infinity to float.as_integer_ratio."); return NULL; } -#ifdef Py_NAN if (Py_IS_NAN(self)) { PyErr_SetString(PyExc_ValueError, "Cannot pass NaN to float.as_integer_ratio."); return NULL; } -#endif PyFPE_START_PROTECT("as_integer_ratio", goto error); float_part = frexp(self, &exponent); /* self == float_part * 2**exponent exactly */
