Skip to content

Commit

Permalink
bpo-42323: Fix math.nextafter() for NaN on AIX (GH-24265)
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Jan 20, 2021
1 parent 7dc71c4 commit c1c3493
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix :func:`math.nextafter` for NaN on AIX.
6 changes: 6 additions & 0 deletions Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3473,6 +3473,12 @@ math_nextafter_impl(PyObject *module, double x, double y)
Bug fixed in bos.adt.libm 7.2.2.0 by APAR IV95512. */
return PyFloat_FromDouble(y);
}
if (Py_IS_NAN(x)) {
return x;
}
if (Py_IS_NAN(y)) {
return y;
}
#endif
return PyFloat_FromDouble(nextafter(x, y));
}
Expand Down

0 comments on commit c1c3493

Please sign in to comment.