mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +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
|
@ -401,12 +401,12 @@ PyLong_FromDouble(double dval)
|
|||
double frac;
|
||||
int i, ndig, expo, neg;
|
||||
neg = 0;
|
||||
if (Py_IS_INFINITY(dval)) {
|
||||
if (isinf(dval)) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"cannot convert float infinity to integer");
|
||||
return NULL;
|
||||
}
|
||||
if (Py_IS_NAN(dval)) {
|
||||
if (isnan(dval)) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"cannot convert float NaN to integer");
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue