aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-11 16:38:28 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-11 16:38:28 +0000
commitf7d258ba14a58e774a967bb8b0c095b47302c2f5 (patch)
treeec0df365f99103a1647f95134b17574fdeabb50d /numeric.c
parent96168ce44d0737fe83653a624a30003f36d8d285 (diff)
downloadruby-f7d258ba14a58e774a967bb8b0c095b47302c2f5.tar.gz
rational.c: optimize Rational#**
* rational.c (nurat_expt): optimize Rational#**. Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_float_pow): rename flo_pow() to rb_float_pow() and remove static to be exporetd. * internal.h (rb_int_pow, rb_float_pow): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/numeric.c b/numeric.c
index 8df969eb49..0a50687776 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1291,8 +1291,8 @@ flo_divmod(VALUE x, VALUE y)
* 2.0**3 #=> 8.0
*/
-static VALUE
-flo_pow(VALUE x, VALUE y)
+VALUE
+rb_float_pow(VALUE x, VALUE y)
{
double dx, dy;
if (RB_TYPE_P(y, T_FIXNUM)) {
@@ -3931,7 +3931,7 @@ fix_pow(VALUE x, VALUE y)
}
}
-static VALUE
+VALUE
rb_int_pow(VALUE x, VALUE y)
{
if (FIXNUM_P(x)) {
@@ -5395,7 +5395,7 @@ Init_Numeric(void)
rb_define_method(rb_cFloat, "%", flo_mod, 1);
rb_define_method(rb_cFloat, "modulo", flo_mod, 1);
rb_define_method(rb_cFloat, "divmod", flo_divmod, 1);
- rb_define_method(rb_cFloat, "**", flo_pow, 1);
+ rb_define_method(rb_cFloat, "**", rb_float_pow, 1);
rb_define_method(rb_cFloat, "==", flo_eq, 1);
rb_define_method(rb_cFloat, "===", flo_eq, 1);
rb_define_method(rb_cFloat, "<=>", flo_cmp, 1);