[Python-checkins] CVS: python/dist/src/Objects longobject.c,1.100,1.101
Tim Peters
tim_one@users.sourceforge.net
Tue, 04 Sep 2001 22:38:12 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv7743/python/Objects
Modified Files:
longobject.c
Log Message:
Try to recover from that glibc's ldexp apparently doesn't set errno on
overflow. Needs testing on Linux (test_long.py and test_long_future.py
especially).
Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -d -r1.100 -r1.101
*** longobject.c 2001/09/04 06:17:36 1.100
--- longobject.c 2001/09/05 05:38:10 1.101
***************
*** 546,550 ****
errno = 0;
x = ldexp(x, e * SHIFT);
! if (errno == ERANGE)
goto overflow;
return x;
--- 546,550 ----
errno = 0;
x = ldexp(x, e * SHIFT);
! if (Py_OVERFLOWED(x))
goto overflow;
return x;
***************
*** 1608,1612 ****
errno = 0;
ad = ldexp(ad, aexp * SHIFT);
! if (ad != 0 && errno == ERANGE) /* ignore underflow to 0.0 */
goto overflow;
return PyFloat_FromDouble(ad);
--- 1608,1612 ----
errno = 0;
ad = ldexp(ad, aexp * SHIFT);
! if (Py_OVERFLOWED(ad)) /* ignore underflow to 0.0 */
goto overflow;
return PyFloat_FromDouble(ad);