bpo-39396: Fix math.nextafter(-0.0, +0.0) on AIX 7.1 (GH-18094)

Move also math.nextafter() on math.ulp() tests from IsCloseTests to
MathTests.
This commit is contained in:
Victor Stinner 2020-01-21 11:14:10 +01:00 committed by GitHub
parent ec64640a2c
commit 85ead4fc62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 86 additions and 79 deletions

View file

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