diff options
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 5da5113..91e0b66 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -545,7 +545,7 @@ PyLong_AsDouble(PyObject *vv) goto overflow; errno = 0; x = ldexp(x, e * SHIFT); - if (errno == ERANGE) + if (Py_OVERFLOWED(x)) goto overflow; return x; @@ -1607,7 +1607,7 @@ long_true_divide(PyObject *v, PyObject *w) goto overflow; errno = 0; ad = ldexp(ad, aexp * SHIFT); - if (ad != 0 && errno == ERANGE) /* ignore underflow to 0.0 */ + if (Py_OVERFLOWED(ad)) /* ignore underflow to 0.0 */ goto overflow; return PyFloat_FromDouble(ad); |