aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-01-29 23:04:50 +0100
committerGitHub <noreply@github.com>2021-01-29 23:04:50 +0100
commit0837f99d3367ecf200033bbddfa05d061ae9f483 (patch)
tree5c0342bb70cedb71dc8b7f5e958752b03eeb6466 /Modules
parentbpo-41282: Add deprecation warning and docs for distutils (PEP 632) (GH-24355) (diff)
downloadcpython-0837f99d3367ecf200033bbddfa05d061ae9f483.tar.gz
cpython-0837f99d3367ecf200033bbddfa05d061ae9f483.tar.bz2
cpython-0837f99d3367ecf200033bbddfa05d061ae9f483.zip
bpo-42323: Fix math.nextafter() on AIX (GH-24381)
math_nextafter_impl() must return a Python object, not a C double.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mathmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 8133d6b3aa..d0df58c63e 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -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));