diff --git a/ChangeLog b/ChangeLog index f9665d592a..be34124a6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Apr 30 20:30:44 2016 Tanaka Akira + + * numeric.c (rb_int_modulo): Define Integer#%. + + * bignum.c (rb_big_modulo): Don't define Bignum#%. + Sat Apr 30 20:17:08 2016 Tanaka Akira * numeric.c (int_equal): Define Integer#==. diff --git a/bignum.c b/bignum.c index 14c8ec8f45..a2590af05c 100644 --- a/bignum.c +++ b/bignum.c @@ -6846,7 +6846,6 @@ Init_Bignum(void) rb_define_method(rb_cBignum, "-", rb_big_minus, 1); rb_define_method(rb_cBignum, "*", rb_big_mul, 1); rb_define_method(rb_cBignum, "/", rb_big_div, 1); - rb_define_method(rb_cBignum, "%", rb_big_modulo, 1); rb_define_method(rb_cBignum, "===", rb_big_eq, 1); diff --git a/numeric.c b/numeric.c index 50c13b8659..c20ce4f76d 100644 --- a/numeric.c +++ b/numeric.c @@ -4943,6 +4943,7 @@ Init_Numeric(void) rb_define_method(rb_cFixnum, "/", fix_div, 1); rb_define_method(rb_cInteger, "div", rb_int_idiv, 1); rb_define_method(rb_cFixnum, "%", fix_mod, 1); + rb_define_method(rb_cInteger, "%", rb_int_modulo, 1); rb_define_method(rb_cInteger, "modulo", rb_int_modulo, 1); rb_define_method(rb_cInteger, "remainder", int_remainder, 1); rb_define_method(rb_cInteger, "divmod", int_divmod, 1);