bpo-42323: Fix math.nextafter() for NaN on AIX (GH-24265)

This commit is contained in:
Victor Stinner 2021-01-20 15:20:13 +01:00 • committed by GitHub
parent 7dc71c425c
commit c1c3493fb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1 @@
Fix :func:`math.nextafter` for NaN on AIX.

View file

@ -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));
}