diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | bignum.c | 10 | ||||
-rw-r--r-- | numeric.c | 4 |
3 files changed, 9 insertions, 12 deletions
@@ -1,3 +1,10 @@ +Sat Apr 30 14:25:55 2016 Tanaka Akira <akr@fsij.org> + + * numeric.c (rb_int_modulo): {Fixnum,Bignum}#modulo is unified into + Integer. + + * bignum.c (rb_big_modulo): Don't define Bignum#modulo. + Sat Apr 30 14:04:30 2016 Tanaka Akira <akr@fsij.org> * numeric.c (int_divmod): {Fixnum,Bignum}#divmod is unified into @@ -6126,15 +6126,6 @@ rb_big_idiv(VALUE x, VALUE y) return rb_big_divide(x, y, rb_intern("div")); } -/* - * call-seq: - * big % other -> Numeric - * big.modulo(other) -> Numeric - * - * Returns big modulo other. See Numeric.divmod for more - * information. - */ - VALUE rb_big_modulo(VALUE x, VALUE y) { @@ -6913,7 +6904,6 @@ Init_Bignum(void) rb_define_method(rb_cBignum, "/", rb_big_div, 1); rb_define_method(rb_cBignum, "%", rb_big_modulo, 1); rb_define_method(rb_cBignum, "div", rb_big_idiv, 1); - rb_define_method(rb_cBignum, "modulo", rb_big_modulo, 1); rb_define_method(rb_cBignum, "remainder", rb_big_remainder, 1); rb_define_method(rb_cBignum, "==", rb_big_eq, 1); @@ -3494,7 +3494,7 @@ rb_int_idiv(VALUE x, VALUE y) /* * Document-method: Fixnum#% - * Document-method: Fixnum#modulo + * Document-method: Integer#modulo * call-seq: * fix % other -> real * fix.modulo(other) -> real @@ -4841,7 +4841,7 @@ Init_Numeric(void) rb_define_method(rb_cFixnum, "/", fix_div, 1); rb_define_method(rb_cFixnum, "div", fix_idiv, 1); rb_define_method(rb_cFixnum, "%", fix_mod, 1); - rb_define_method(rb_cFixnum, "modulo", fix_mod, 1); + rb_define_method(rb_cInteger, "modulo", rb_int_modulo, 1); rb_define_method(rb_cInteger, "divmod", int_divmod, 1); rb_define_method(rb_cInteger, "fdiv", int_fdiv, 1); rb_define_method(rb_cInteger, "**", rb_int_pow, 1); |