[pypy-commit] pypy improve-rbigint: Cleanup

Stian Andreassen noreply at buildbot.pypy.org
Sat Jul 21 18:40:55 CEST 2012


Author: Stian Andreassen
Branch: improve-rbigint
Changeset: r56310:db57975370e1
Date: 2012-06-21 22:22 +0200
http://bitbucket.org/pypy/pypy/changeset/db57975370e1/

Log:	Cleanup

diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -858,7 +858,7 @@
                 carry >>= SHIFT
             if carry:
                 z.setdigit(pz, z.widedigit(pz) + carry)
-            assert (carry >> 63) == 0
+            assert (carry >> SHIFT) == 0
             i += 1
     else:"""
     # gradeschool long mult
@@ -1085,10 +1085,9 @@
     # Successive slices of b are copied into bslice.
     #bslice = rbigint([0] * asize, 1)
     # XXX we cannot pre-allocate, see comments below!
+    bslice = rbigint([NULLDIGIT], 1)
     
     nbdone = 0;
-    bslice = rbigint([NULLDIGIT], 1)
-
     while bsize > 0:
         nbtouse = min(bsize, asize)
 
@@ -1196,7 +1195,6 @@
         i += 1
     return borrow
 
-
 def _muladd1(a, n, extra=0):
     """Multiply by a single digit and add a single digit, ignoring the sign.
     """
@@ -1214,7 +1212,6 @@
     z._normalize()
     return z
 
-
 def _x_divrem(v1, w1):
     """ Unsigned bigint division with remainder -- the algorithm """
     size_w = w1.numdigits()
@@ -1289,7 +1286,6 @@
     rem, _ = _divrem1(v, d)
     return a, rem
 
-
 def _divrem(a, b):
     """ Long division with remainder, top-level routine """
     size_a = a.numdigits()


More information about the pypy-commit mailing list