From 24e33b84b5adb29d1d2f541acfba65e225b91b55 Mon Sep 17 00:00:00 2001 From: Kouhei Yanagita Date: Thu, 21 Jul 2022 18:57:13 +0900 Subject: Remove Numeric#ceildiv --- numeric.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index df0c016b9e..9574bfe024 100644 --- a/numeric.c +++ b/numeric.c @@ -656,31 +656,6 @@ num_div(VALUE x, VALUE y) return rb_funcall(num_funcall1(x, '/', y), rb_intern("floor"), 0); } -/* - * call-seq: - * ceildiv(other) -> integer - * - * Returns the quotient self/other as an integer, rounding up to the nearest integer. - * This method uses method +/+ in the derived class of +self+. - * (\Numeric itself does not define method +/+.) - * - * Of the Core and Standard Library classes, - * Float and Rational use this implementation. - * - * 3.0.ceildiv(3.0) # => 1 - * 4.0.ceildiv(3.0) # => 2 - * - * 4.0.ceildiv(-3.0) # => -1 - * -4.0.ceildiv(3.0) # => -1 - * -4.0.ceildiv(-3.0) # => 2 - */ -static VALUE -num_ceildiv(VALUE x, VALUE y) -{ - VALUE tmp = num_div(x, num_uminus(y)); - return num_uminus(tmp); -} - /* * call-seq: * self % other -> real_numeric @@ -6247,7 +6222,6 @@ Init_Numeric(void) rb_define_method(rb_cNumeric, "<=>", num_cmp, 1); rb_define_method(rb_cNumeric, "eql?", num_eql, 1); rb_define_method(rb_cNumeric, "fdiv", num_fdiv, 1); - rb_define_method(rb_cNumeric, "ceildiv", num_ceildiv, 1); rb_define_method(rb_cNumeric, "div", num_div, 1); rb_define_method(rb_cNumeric, "divmod", num_divmod, 1); rb_define_method(rb_cNumeric, "%", num_modulo, 1); -- cgit v1.2.1