Skip to content

Commit

Permalink
bpo-42323: Fix math.nextafter() on AIX (GH-24381)
Browse files Browse the repository at this point in the history
math_nextafter_impl() must return a Python object, not a C double.
  • Loading branch information
vstinner authored Jan 29, 2021
1 parent 62949f6 commit 0837f99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3474,10 +3474,10 @@ math_nextafter_impl(PyObject *module, double x, double y)
return PyFloat_FromDouble(y);
}
if (Py_IS_NAN(x)) {
return x;
return PyFloat_FromDouble(x);
}
if (Py_IS_NAN(y)) {
return y;
return PyFloat_FromDouble(y);
}
#endif
return PyFloat_FromDouble(nextafter(x, y));
Expand Down

0 comments on commit 0837f99

Please sign in to comment.