From 088deb9da88e49c930a024efa691ee42cdec4986 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 24 May 2005 15:24:23 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@8516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index e3f29ea46..86c180ccd 100644 --- a/numeric.c +++ b/numeric.c @@ -2197,6 +2197,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); } -- cgit