summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-21 16:49:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-21 16:49:00 +0000
commit8de500cefca5e021f9fc792badddfddf48b1b409 (patch)
tree39c1e2a9286130cae208e40aea25cfa4d111fe00 /bignum.c
parent3d23725ab9b0a01e747b78c46473c3bfa3ff31dd (diff)
bignum.c: keep first zero
* bignum.c (bigdivrem): keep first digit even if zero. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 3f59b8edf9..6fb031e198 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2812,7 +2812,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
if (modp) { /* normalize remainder */
*modp = zz = rb_big_clone(z);
zds = BDIGITS(zz);
- while (ny > 0 && !zds[ny-1]) --ny;
+ while (ny > 1 && !zds[ny-1]) --ny;
if (dd) {
t2 = 0; i = ny;
while(i--) {