[pypy-svn] pypy default: Tweak.

arigo commits-noreply at bitbucket.org
Tue Jan 18 18:22:26 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r40889:6c11d4dd9e3c
Date: 2011-01-18 17:29 +0100
http://bitbucket.org/pypy/pypy/changeset/6c11d4dd9e3c/

Log:	Tweak.

diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -1333,8 +1333,8 @@
     # ties rounded to even).
     q = (q >> 2) + (bool(q & 2) and bool(q & 5))
 
-    if (exp > DBL_MAX_EXP or (exp == DBL_MAX_EXP and
-                              q == r_ulonglong(2) ** DBL_MANT_DIG)):
+    if exp > DBL_MAX_EXP or (exp == DBL_MAX_EXP and
+                             q == r_ulonglong(1) << DBL_MANT_DIG):
         raise OverflowError("integer too large to convert to float")
 
     ad = math.ldexp(float(q), exp - DBL_MANT_DIG)


More information about the Pypy-commit mailing list