mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (num_cmp): define Numeric#<=>, remove Numeric#==.
* eval.c (backtrace): should ignore line 0 frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@3119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b2b3cec36b
commit
a38ea9ec29
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Dec 6 14:13:59 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* numeric.c (num_cmp): define Numeric#<=>, remove Numeric#==.
|
||||
|
||||
Tue Dec 3 01:48:06 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (backtrace): should ignore line 0 frame.
|
||||
|
|
10
numeric.c
10
numeric.c
|
@ -422,6 +422,14 @@ num_eql(x, y)
|
|||
return rb_equal(x, y);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
num_cmp(x, y)
|
||||
VALUE x, y;
|
||||
{
|
||||
if (x == y) return INT2FIX(0);
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
num_equal(x, y)
|
||||
VALUE x, y;
|
||||
|
@ -1559,8 +1567,8 @@ Init_Numeric()
|
|||
|
||||
rb_define_method(rb_cNumeric, "+@", num_uplus, 0);
|
||||
rb_define_method(rb_cNumeric, "-@", num_uminus, 0);
|
||||
rb_define_method(rb_cNumeric, "==", num_equal, 1);
|
||||
rb_define_method(rb_cNumeric, "===", num_equal, 1);
|
||||
rb_define_method(rb_cNumeric, "<=>", num_cmp, 1);
|
||||
rb_define_method(rb_cNumeric, "eql?", num_eql, 1);
|
||||
rb_define_method(rb_cNumeric, "divmod", num_divmod, 1);
|
||||
rb_define_method(rb_cNumeric, "modulo", num_modulo, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue