summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--bignum.c10
-rw-r--r--numeric.c4
3 files changed, 9 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index ba55ed694a..5d49f72f1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/bignum.c b/bignum.c
index 53dac8ad0b..8c23291434 100644
--- a/bignum.c
+++ b/bignum.c
@@ -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);
diff --git a/numeric.c b/numeric.c
index f291e3a948..40d6139243 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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);