aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-22 05:21:12 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-22 05:21:12 +0000
commitf80c76f92efd79cc2918b8e57c8a400c7583caf1 (patch)
tree866bcda089a7cec53fd52e119b1a60b7e4efb745 /numeric.c
parentc3b3a34c03df4b65154700132ba5c375dffa8802 (diff)
downloadruby-f80c76f92efd79cc2918b8e57c8a400c7583caf1.tar.gz
complex.c: optimize f_gt_p some cases
* complex.c (f_gt_p): optimize f_gt_p for specific types of arguments. * internal.h (rb_int_gt, rb_float_gt, rb_rational_cmp): exported. * numeric.c (rb_float_gt): rename from flo_gt and be exported. * numeric.c (rb_int_gt): rename from int_gt and be exported. * rational.c (rb_rational_cmp): rename from nurat_cmp and be exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/numeric.c b/numeric.c
index e82f0bd518..38668ec0d9 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1494,8 +1494,8 @@ flo_cmp(VALUE x, VALUE y)
* implementation-dependent value is returned.
*/
-static VALUE
-flo_gt(VALUE x, VALUE y)
+VALUE
+rb_float_gt(VALUE x, VALUE y)
{
double a, b;
@@ -4074,8 +4074,8 @@ fix_gt(VALUE x, VALUE y)
}
}
-static VALUE
-int_gt(VALUE x, VALUE y)
+VALUE
+rb_int_gt(VALUE x, VALUE y)
{
if (FIXNUM_P(x)) {
return fix_gt(x, y);
@@ -5270,7 +5270,7 @@ Init_Numeric(void)
rb_define_method(rb_cInteger, "===", rb_int_equal, 1);
rb_define_method(rb_cInteger, "==", rb_int_equal, 1);
- rb_define_method(rb_cInteger, ">", int_gt, 1);
+ rb_define_method(rb_cInteger, ">", rb_int_gt, 1);
rb_define_method(rb_cInteger, ">=", rb_int_ge, 1);
rb_define_method(rb_cInteger, "<", int_lt, 1);
rb_define_method(rb_cInteger, "<=", int_le, 1);
@@ -5411,7 +5411,7 @@ Init_Numeric(void)
rb_define_method(rb_cFloat, "==", flo_eq, 1);
rb_define_method(rb_cFloat, "===", flo_eq, 1);
rb_define_method(rb_cFloat, "<=>", flo_cmp, 1);
- rb_define_method(rb_cFloat, ">", flo_gt, 1);
+ rb_define_method(rb_cFloat, ">", rb_float_gt, 1);
rb_define_method(rb_cFloat, ">=", flo_ge, 1);
rb_define_method(rb_cFloat, "<", flo_lt, 1);
rb_define_method(rb_cFloat, "<=", flo_le, 1);