diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 05:43:15 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 05:43:15 +0000 |
commit | 73dd745cf1c742d62d8662ef69ec13ec7c30924f (patch) | |
tree | ddb41cd95d7e24eaae2d831f3dc14c4207242c62 | |
parent | 728333dcd329a7dd5c423a2a2b564dc01312c9e0 (diff) | |
download | ruby-73dd745cf1c742d62d8662ef69ec13ec7c30924f.tar.gz |
{Fixnum,Bignum}#div is unified into Integer.
* numeric.c (rb_int_idiv): {Fixnum,Bignum}#div is unified into
Integer.
* bignum.c (rb_big_idiv): Don't define Bignum#div.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | bignum.c | 8 | ||||
-rw-r--r-- | numeric.c | 8 |
3 files changed, 11 insertions, 12 deletions
@@ -1,3 +1,10 @@ +Sat Apr 30 14:42:20 2016 Tanaka Akira <akr@fsij.org> + + * numeric.c (rb_int_idiv): {Fixnum,Bignum}#div is unified into + Integer. + + * bignum.c (rb_big_idiv): Don't define Bignum#div. + Sat Apr 30 14:25:55 2016 Tanaka Akira <akr@fsij.org> * numeric.c (rb_int_modulo): {Fixnum,Bignum}#modulo is unified into @@ -6113,13 +6113,6 @@ rb_big_div(VALUE x, VALUE y) return rb_big_divide(x, y, '/'); } -/* - * call-seq: - * big.div(other) -> integer - * - * Performs integer division: returns integer value. - */ - VALUE rb_big_idiv(VALUE x, VALUE y) { @@ -6903,7 +6896,6 @@ Init_Bignum(void) 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, "div", rb_big_idiv, 1); rb_define_method(rb_cBignum, "remainder", rb_big_remainder, 1); rb_define_method(rb_cBignum, "==", rb_big_eq, 1); @@ -3466,11 +3466,11 @@ fix_div(VALUE x, VALUE y) } /* - * Document-method: Fixnum#div + * Document-method: Integer#div * call-seq: - * fix.div(numeric) -> integer + * int.div(numeric) -> integer * - * Performs integer division: returns integer result of dividing +fix+ by + * Performs integer division: returns integer result of dividing +int+ by * +numeric+. */ @@ -4839,7 +4839,7 @@ Init_Numeric(void) rb_define_method(rb_cFixnum, "-", fix_minus, 1); rb_define_method(rb_cFixnum, "*", fix_mul, 1); rb_define_method(rb_cFixnum, "/", fix_div, 1); - rb_define_method(rb_cFixnum, "div", fix_idiv, 1); + rb_define_method(rb_cInteger, "div", rb_int_idiv, 1); rb_define_method(rb_cFixnum, "%", fix_mod, 1); rb_define_method(rb_cInteger, "modulo", rb_int_modulo, 1); rb_define_method(rb_cInteger, "divmod", int_divmod, 1); |