summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bignum.c b/bignum.c
index 0fa2233ebc..3cf4544cb4 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1217,10 +1217,10 @@ bigdivrem(x, y, divp, modp)
for (i = 0;i < j;i++) zds[i] = zds[i+ny];
RBIGNUM(*divp)->len = i;
}
- if (modp) { /* just normalize remainder */
+ if (modp) { /* normalize remainder */
*modp = rb_big_clone(z);
zds = BDIGITS(*modp);
- while (ny-- && !zds[ny]); ++ny;
+ while (--ny && !zds[ny]); ++ny;
if (dd) {
t2 = 0; i = ny;
while(i--) {