[pypy-commit] pypy improve-rbigint: Make test_decimal (the last test) pass.

Stian Andreassen noreply at buildbot.pypy.org
Mon Aug 27 22:12:20 CEST 2012


Author: Stian Andreassen
Branch: improve-rbigint
Changeset: r56892:92f8a4632989
Date: 2012-08-27 22:11 +0200
http://bitbucket.org/pypy/pypy/changeset/92f8a4632989/

Log:	Make test_decimal (the last test) pass.

diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -1554,7 +1554,10 @@
         at most (and usually exactly) k = size_v - size_w digits. """
     k = size_v - size_w
     if k == 0:
-        return NULLRBIGINT, v1
+        # We can't use v1, nor NULLRBIGINT here as some function modify the result.
+        assert _v_rshift(w, v, size_w, d) == 0
+        w._normalize()
+        return rbigint([NULLDIGIT]), w
     
     assert k > 0
     a = rbigint([NULLDIGIT] * k, 1, k)


More information about the pypy-commit mailing list