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 f2104f042c..7f02bcace7 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2544,6 +2544,8 @@ rb_big_pow(VALUE x, VALUE y)
switch (TYPE(y)) {
case T_FLOAT:
d = RFLOAT_VALUE(y);
+ if ((!RBIGNUM_SIGN(x) && !BIGZEROP(x)) && d != round(d))
+ return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
break;
case T_BIGNUM: