8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96f99cd commit 3df127eCopy full SHA for 3df127e
Modules/mathmodule.c
@@ -2190,10 +2190,12 @@ math_modf_impl(PyObject *module, double x)
2190
double y;
2191
/* some platforms don't do the right thing for NaNs and
2192
infinities, so we take care of special cases directly. */
2193
- if (Py_IS_INFINITY(x))
2194
- return Py_BuildValue("(dd)", copysign(0., x), x);
2195
- else if (Py_IS_NAN(x))
2196
- return Py_BuildValue("(dd)", x, x);
+ if (!Py_IS_FINITE(x)) {
+ if (Py_IS_INFINITY(x))
+ return Py_BuildValue("(dd)", copysign(0., x), x);
+ else
2197
+ return Py_BuildValue("(dd)", x, x);
2198
+ }
2199
2200
errno = 0;
2201
x = modf(x, &y);
0 commit comments