diff options
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 53 |
1 files changed, 0 insertions, 53 deletions
@@ -1384,24 +1384,6 @@ flo_truncate(VALUE num) return LONG2FIX(val); } -static VALUE -flo_numerator(VALUE num) -{ - double d = RFLOAT_VALUE(num); - if (isinf(d) || isnan(d)) - return num; - return rb_call_super(0, 0); -} - -static VALUE -flo_denominator(VALUE num) -{ - double d = RFLOAT_VALUE(num); - if (isinf(d) || isnan(d)) - return INT2FIX(1); - return rb_call_super(0, 0); -} - /* * call-seq: * num.floor => integer @@ -1789,20 +1771,6 @@ rb_num2ull(VALUE val) #endif /* HAVE_LONG_LONG */ -static VALUE -num_numerator(VALUE num) -{ - return rb_funcall(rb_funcall(num, rb_intern("to_r"), 0), - rb_intern("numerator"), 0); -} - -static VALUE -num_denominator(VALUE num) -{ - return rb_funcall(rb_funcall(num, rb_intern("to_r"), 0), - rb_intern("denominator"), 0); -} - /* * Document-class: Integer * @@ -2006,18 +1974,6 @@ int_ord(num) return num; } -static VALUE -int_numerator(VALUE num) -{ - return num; -} - -static VALUE -int_denominator(VALUE num) -{ - return INT2FIX(1); -} - /******************************************************************** * * Document-class: Fixnum @@ -3190,9 +3146,6 @@ Init_Numeric(void) rb_define_method(rb_cNumeric, "truncate", num_truncate, 0); rb_define_method(rb_cNumeric, "step", num_step, -1); - rb_define_method(rb_cNumeric, "numerator", num_numerator, 0); - rb_define_method(rb_cNumeric, "denominator", num_denominator, 0); - rb_cInteger = rb_define_class("Integer", rb_cNumeric); rb_undef_alloc_func(rb_cInteger); rb_undef_method(CLASS_OF(rb_cInteger), "new"); @@ -3215,9 +3168,6 @@ Init_Numeric(void) rb_define_method(rb_cInteger, "truncate", int_to_i, 0); rb_define_method(rb_cInteger, "round", int_round, -1); - rb_define_method(rb_cInteger, "numerator", int_numerator, 0); - rb_define_method(rb_cInteger, "denominator", int_denominator, 0); - rb_cFixnum = rb_define_class("Fixnum", rb_cInteger); rb_define_method(rb_cFixnum, "to_s", fix_to_s, -1); @@ -3310,9 +3260,6 @@ Init_Numeric(void) rb_define_method(rb_cFloat, "round", flo_round, -1); rb_define_method(rb_cFloat, "truncate", flo_truncate, 0); - rb_define_method(rb_cFloat, "numerator", flo_numerator, 0); - rb_define_method(rb_cFloat, "denominator", flo_denominator, 0); - rb_define_method(rb_cFloat, "nan?", flo_is_nan_p, 0); rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0); rb_define_method(rb_cFloat, "finite?", flo_is_finite_p, 0); |