summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index 6a7a83c085..df702e26ca 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1617,8 +1617,10 @@ rb_big_pow(x, y)
while (yy % 2 == 0) {
yy /= 2;
x = rb_big_mul(x, x);
+ if (!BDIGITS(x)[RBIGNUM(x)->len-1]) RBIGNUM(x)->len--;
}
z = rb_big_mul(z, x);
+ if (!BDIGITS(z)[RBIGNUM(z)->len-1]) RBIGNUM(z)->len--;
}
return bignorm(z);
}