summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-30 06:30:08 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-30 06:30:08 (GMT)
commitae225a2ca84ea84da0c7c15ad07b9e89fbbb9392 (patch)
treec1bc31a27c810ad11df564490292369bdc0b7525 /numeric.c
parent73dd745cf1c742d62d8662ef69ec13ec7c30924f (diff)
{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
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/numeric.c b/numeric.c
index 9254545..e772b01 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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);