diff options
author | Victor Stinner <vstinner@python.org> | 2021-01-29 22:04:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 22:04:50 (GMT) |
commit | 0837f99d3367ecf200033bbddfa05d061ae9f483 (patch) | |
tree | 5c0342bb70cedb71dc8b7f5e958752b03eeb6466 /Modules/mathmodule.c | |
parent | 62949f697fdefbf0c8bbba7a8354b9376afa35ba (diff) | |
download | cpython-0837f99d3367ecf200033bbddfa05d061ae9f483.zip cpython-0837f99d3367ecf200033bbddfa05d061ae9f483.tar.gz cpython-0837f99d3367ecf200033bbddfa05d061ae9f483.tar.bz2 |
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/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 8133d6b..d0df58c 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)); |