numeric.c: update error messages in int_pow; ref #5420

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-04-21 22:08:07 +09:00
parent 5cf1de5b31
commit 91c4ac8d66
+2 -2
View File
@@ -103,13 +103,13 @@ int_pow(mrb_state *mrb, mrb_value x)
for (;;) {
if (exp & 1) {
if (mrb_int_mul_overflow(result, base, &result)) {
int_overflow(mrb, "multiplication");
int_overflow(mrb, "power");
}
}
exp >>= 1;
if (exp == 0) break;
if (mrb_int_mul_overflow(base, base, &base)) {
int_overflow(mrb, "multiplication");
int_overflow(mrb, "power");
}
}
return mrb_int_value(mrb, result);