summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-24 14:52:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-24 14:52:05 +0000
commitc33063f42d7d7e82152409f88ee3c9b56f9eca53 (patch)
treea3e147709f95e7344bc1ac9bc4ec25d22f99e640 /numeric.c
parentdf18044d22f93db7780bcf5784689b69572227fc (diff)
* numeric.c (fix_pow): support Fixnum ** Float case directly
without coercing. [ruby-talk:142697] [ruby-talk:143054] * ruby.c (require_libraries): caused SEGV when continuation jumped in to the required library code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index 65d9d5cb11..e5a03e1a82 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2196,6 +2196,9 @@ fix_pow(x, y)
return rb_big_pow(rb_int2big(a), y);
}
return rb_float_new(pow((double)a, (double)b));
+ } else if (TYPE(y) == T_FLOAT) {
+ long a = FIX2LONG(x);
+ return rb_float_new(pow((double)a, RFLOAT(y)->value));
}
return rb_num_coerce_bin(x, y);
}