gh-119613: Use C99+ functions instead of Py_IS_NAN/INFINITY/FINITE (#119619)

This commit is contained in:
Sergey B Kirpichev 2024-05-29 10:51:19 +03:00 committed by GitHub
parent 86d1a1aa88
commit cd11ff12ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 140 additions and 142 deletions

View file

@ -2640,7 +2640,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
/* Avoid losing the sign on a negative result,
and don't let adding the compensation convert
an infinite or overflowed sum to a NaN. */
if (c && Py_IS_FINITE(c)) {
if (c && isfinite(c)) {
f_result += c;
}
return PyFloat_FromDouble(f_result);
@ -2672,7 +2672,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
continue;
}
}
if (c && Py_IS_FINITE(c)) {
if (c && isfinite(c)) {
f_result += c;
}
result = PyFloat_FromDouble(f_result);