summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorS.H <[email protected]>2021-02-20 04:11:19 +0900
committerGitHub <[email protected]>2021-02-19 11:11:19 -0800
commitefd19badf43f4f1f24d5aec8a28e94a6e1e47b5b (patch)
treed0f1b01082418d2434d5380cbb427bbccf095b6c /numeric.c
parent837e77e0202e96060498794ff97a097e5440d148 (diff)
Improve performance some Numeric methods [Feature #17632] (#4190)
Notes
Notes: Merged-By: k0kubun <[email protected]>
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/numeric.c b/numeric.c
index bcc0ab7c61..167eed6068 100644
--- a/numeric.c
+++ b/numeric.c
@@ -712,35 +712,6 @@ num_divmod(VALUE x, VALUE y)
/*
* call-seq:
- * num.real? -> true or false
- *
- * Returns +true+ if +num+ is a real number (i.e. not Complex).
- */
-
-static VALUE
-num_real_p(VALUE num)
-{
- return Qtrue;
-}
-
-/*
- * call-seq:
- * num.integer? -> true or false
- *
- * Returns +true+ if +num+ is an Integer.
- *
- * 1.0.integer? #=> false
- * 1.integer? #=> true
- */
-
-static VALUE
-num_int_p(VALUE num)
-{
- return Qfalse;
-}
-
-/*
- * call-seq:
* num.abs -> numeric
* num.magnitude -> numeric
*
@@ -826,31 +797,6 @@ num_nonzero_p(VALUE num)
/*
* call-seq:
- * num.finite? -> true or false
- *
- * Returns +true+ if +num+ is a finite number, otherwise returns +false+.
- */
-static VALUE
-num_finite_p(VALUE num)
-{
- return Qtrue;
-}
-
-/*
- * call-seq:
- * num.infinite? -> -1, 1, or nil
- *
- * Returns +nil+, -1, or 1 depending on whether the value is
- * finite, <code>-Infinity</code>, or <code>+Infinity</code>.
- */
-static VALUE
-num_infinite_p(VALUE num)
-{
- return Qnil;
-}
-
-/*
- * call-seq:
* num.to_int -> integer
*
* Invokes the child class's +to_i+ method to convert +num+ to an integer.
@@ -5430,12 +5376,8 @@ Init_Numeric(void)
rb_define_method(rb_cNumeric, "magnitude", num_abs, 0);
rb_define_method(rb_cNumeric, "to_int", num_to_int, 0);
- rb_define_method(rb_cNumeric, "real?", num_real_p, 0);
- rb_define_method(rb_cNumeric, "integer?", num_int_p, 0);
rb_define_method(rb_cNumeric, "zero?", num_zero_p, 0);
rb_define_method(rb_cNumeric, "nonzero?", num_nonzero_p, 0);
- rb_define_method(rb_cNumeric, "finite?", num_finite_p, 0);
- rb_define_method(rb_cNumeric, "infinite?", num_infinite_p, 0);
rb_define_method(rb_cNumeric, "floor", num_floor, -1);
rb_define_method(rb_cNumeric, "ceil", num_ceil, -1);