Author: stian
Branch:
Changeset: r57087:ba4a11d21ccc
Date: 2012-09-02 17:38 +0200
http://bitbucket.org/pypy/pypy/changeset/ba4a11d21ccc/
Log: Backed out changeset a988d66682e8
diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -168,9 +168,14 @@
# waste of time and space given that 5*15 = 75 bits are rarely
# needed.
# XXX: Even better!
- assert SHIFT == LONG_BIT - 1
- return rbigint([_store_digit(ival)], sign, 1)
- """
+ if SHIFT >= 63:
+ carry = ival >> SHIFT
+ if carry:
+ return rbigint([_store_digit(ival & MASK),
+ _store_digit(carry & MASK)], sign, 2)
+ else:
+ return rbigint([_store_digit(ival & MASK)], sign, 1)
+
t = ival
ndigits = 0
while t:
@@ -184,7 +189,7 @@
t >>= SHIFT
p += 1
- return v"""
+ return v
@staticmethod
def frombool(b):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit