bpo-42323: Fix math.nextafter() on AIX (GH-24381)

math_nextafter_impl() must return a Python object, not a C double.
This commit is contained in:
Victor Stinner
2021-01-29 23:04:50 +01:00
committed by GitHub
parent 62949f697f
commit 0837f99d33

View File

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