diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 06:30:08 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 06:30:08 +0000 |
commit | ae225a2ca84ea84da0c7c15ad07b9e89fbbb9392 (patch) | |
tree | c1bc31a27c810ad11df564490292369bdc0b7525 | |
parent | 73dd745cf1c742d62d8662ef69ec13ec7c30924f (diff) | |
download | ruby-ae225a2ca84ea84da0c7c15ad07b9e89fbbb9392.tar.gz |
{Fixnum,Bignum}#-@ is unified into Integer.
* numeric.c (rb_int_uminus): {Fixnum,Bignum}#-@ is unified into
Integer.
* bignum.c (rb_big_uminus): Don't define Bignum#-@.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | bignum.c | 8 | ||||
-rw-r--r-- | numeric.c | 9 |
3 files changed, 12 insertions, 12 deletions
@@ -1,3 +1,10 @@ +Sat Apr 30 15:29:24 2016 Tanaka Akira <akr@fsij.org> + + * numeric.c (rb_int_uminus): {Fixnum,Bignum}#-@ is unified into + Integer. + + * bignum.c (rb_big_uminus): Don't define Bignum#-@. + Sat Apr 30 14:42:20 2016 Tanaka Akira <akr@fsij.org> * numeric.c (rb_int_idiv): {Fixnum,Bignum}#div is unified into @@ -5529,13 +5529,6 @@ rb_big_eql(VALUE x, VALUE y) return Qtrue; } -/* - * call-seq: - * -big -> integer - * - * Unary minus (returns an integer whose value is 0-big) - */ - VALUE rb_big_uminus(VALUE x) { @@ -6890,7 +6883,6 @@ Init_Bignum(void) rb_cBignum = rb_define_class("Bignum", rb_cInteger); rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1); - rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0); rb_define_method(rb_cBignum, "+", rb_big_plus, 1); rb_define_method(rb_cBignum, "-", rb_big_minus, 1); rb_define_method(rb_cBignum, "*", rb_big_mul, 1); @@ -3122,11 +3122,12 @@ int_ord(VALUE num) /* - * Document-method: Fixnum#-@ + * Document-method: Integer#-@ * call-seq: - * -fix -> integer + * -int -> integer * - * Negates +fix+, which may return a Bignum. + * Negates +int+. + * (returns an integer whose value is 0-int) */ static VALUE @@ -4834,7 +4835,7 @@ Init_Numeric(void) rb_cFixnum = rb_define_class("Fixnum", rb_cInteger); - rb_define_method(rb_cFixnum, "-@", fix_uminus, 0); + rb_define_method(rb_cFixnum, "-@", rb_int_uminus, 0); rb_define_method(rb_cFixnum, "+", fix_plus, 1); rb_define_method(rb_cFixnum, "-", fix_minus, 1); rb_define_method(rb_cFixnum, "*", fix_mul, 1); |