diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-16 23:03:45 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-16 23:03:45 +0000 |
commit | 02a7cbec822ba2f2c1b830a9f1747e84822aaddf (patch) | |
tree | 850fd24aeb7b04a1eb4cc090e687110227ac1c0c /bignum.c | |
parent | b21088b431e03d15032caad160888e16b8f2198b (diff) | |
download | ruby-02a7cbec822ba2f2c1b830a9f1747e84822aaddf.tar.gz |
* 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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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: |