aboutsummaryrefslogtreecommitdiffstats
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 dd29124995..e3e8d80d9a 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1553,8 +1553,10 @@ rb_big_pow(VALUE x, VALUE y)
while (yy % 2 == 0) {
yy /= 2;
x = rb_big_mul0(x, x);
+ if (!BDIGITS(x)[RBIGNUM(x)->len-1]) RBIGNUM(x)->len--;
}
z = rb_big_mul0(z, x);
+ if (!BDIGITS(z)[RBIGNUM(z)->len-1]) RBIGNUM(z)->len--;
}
return bignorm(z);
}