summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-16 23:03:45 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-16 23:03:45 +0000
commit02a7cbec822ba2f2c1b830a9f1747e84822aaddf (patch)
tree850fd24aeb7b04a1eb4cc090e687110227ac1c0c /bignum.c
parentb21088b431e03d15032caad160888e16b8f2198b (diff)
* numeric.c (flo_pow,fix_pow): may return complex number.
* bignum.c (rb_big_pow): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: