mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
gh-119613: Use C99+ functions instead of Py_IS_NAN/INFINITY/FINITE (#119619)
This commit is contained in:
parent
86d1a1aa88
commit
cd11ff12ac
12 changed files with 140 additions and 142 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue