Commits

stian  committed ba4a11d

Backed out changeset a988d66682e8

  • Participants
  • Parent commits a988d66

Comments (0)

Files changed (1)

File pypy/rlib/rbigint.py

         # 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:
             t >>= SHIFT
             p += 1
 
-        return v"""
+        return v
 
     @staticmethod
     def frombool(b):