diff options
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 81d8717..f012b51 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -3287,8 +3287,14 @@ static PyObject * math_nextafter_impl(PyObject *module, double x, double y) /*[clinic end generated code: output=750c8266c1c540ce input=02b2d50cd1d9f9b6]*/ { - double f = nextafter(x, y); - return PyFloat_FromDouble(f); +#if defined(_AIX) + if (x == y) { + /* On AIX 7.1, libm nextafter(-0.0, +0.0) returns -0.0. + Bug fixed in bos.adt.libm 7.2.2.0 by APAR IV95512. */ + return PyFloat_FromDouble(y); + } +#endif + return PyFloat_FromDouble(nextafter(x, y)); } |