summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-12 15:43:26 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-12 15:43:26 +0000
commitbdd18a2c313414981aa1f457eec49bf13a8d1048 (patch)
treee3ca93b0ce2a1dbd69ca5a93abee9ec6debf0de3 /numeric.c
parentedfa67c2486ec18d6fe74f0786ef0a2f08faff09 (diff)
downloadbundler-bdd18a2c313414981aa1f457eec49bf13a8d1048.tar.gz
rational.c: optimize Integer#lcm
* rational.c (f_div, f_mul, f_abs): optimize Integer#lcm Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_int_abs): rename from int_abs to be exported. * internal.h (rb_int_div, rb_int_abs): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56759 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 590bec72e1..1bb939c333 100644
--- a/numeric.c
+++ b/numeric.c
@@ -4561,8 +4561,8 @@ fix_abs(VALUE fix)
return LONG2NUM(i);
}
-static VALUE
-int_abs(VALUE num)
+VALUE
+rb_int_abs(VALUE num)
{
if (FIXNUM_P(num)) {
return fix_abs(num);
@@ -5250,8 +5250,8 @@ Init_Numeric(void)
rb_define_method(rb_cInteger, "fdiv", rb_int_fdiv, 1);
rb_define_method(rb_cInteger, "**", rb_int_pow, 1);
- rb_define_method(rb_cInteger, "abs", int_abs, 0);
- rb_define_method(rb_cInteger, "magnitude", int_abs, 0);
+ rb_define_method(rb_cInteger, "abs", rb_int_abs, 0);
+ rb_define_method(rb_cInteger, "magnitude", rb_int_abs, 0);
rb_define_method(rb_cInteger, "===", rb_int_equal, 1);
rb_define_method(rb_cInteger, "==", rb_int_equal, 1);