From e27a06f4bbf0723cd19a943c41dff3125ed0a69d Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 30 Apr 2016 11:31:28 +0000 Subject: [PATCH] Define Integer#% instead of Bignum#%. * numeric.c (rb_int_modulo): Define Integer#%. * bignum.c (rb_big_modulo): Don't define Bignum#%. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ bignum.c | 1 - numeric.c | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) 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);