diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-12 15:43:26 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-12 15:43:26 +0000 |
commit | bdd18a2c313414981aa1f457eec49bf13a8d1048 (patch) | |
tree | e3ca93b0ce2a1dbd69ca5a93abee9ec6debf0de3 /numeric.c | |
parent | edfa67c2486ec18d6fe74f0786ef0a2f08faff09 (diff) | |
download | bundler-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); |