mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5a8bfc39f1
commit
4f51d81418
14 changed files with 90 additions and 50 deletions
|
@ -70,7 +70,7 @@ do_coerce(x, y)
|
|||
VALUE a[2];
|
||||
|
||||
a[0] = *x; a[1] = *y;
|
||||
ary = rb_rescue(coerce_body, (VALUE)a, coerce_rescue, (VALUE)a);
|
||||
ary = rb_rescue2(coerce_body, (VALUE)a, rb_eNameError, coerce_rescue, (VALUE)a);
|
||||
if (TYPE(ary) != T_ARRAY || RARRAY(ary)->len != 2) {
|
||||
rb_raise(rb_eTypeError, "coerce must return [x, y]");
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ static VALUE
|
|||
num_remainder(x, y)
|
||||
VALUE x, y;
|
||||
{
|
||||
rb_warn("remainder is deprecated; use % opearator");
|
||||
rb_warn("remainder is deprecated; use %% opearator");
|
||||
return rb_funcall(x, '%', 1, y);
|
||||
}
|
||||
|
||||
|
@ -353,8 +353,7 @@ static VALUE
|
|||
flo_divmod(x, y)
|
||||
VALUE x, y;
|
||||
{
|
||||
double fy;
|
||||
VALUE div, mod;
|
||||
double fy, div, mod;
|
||||
|
||||
switch (TYPE(y)) {
|
||||
case T_FIXNUM:
|
||||
|
@ -1508,6 +1507,7 @@ Init_Numeric()
|
|||
rb_define_method(rb_cNumeric, "===", num_equal, 1);
|
||||
rb_define_method(rb_cNumeric, "eql?", num_eql, 1);
|
||||
rb_define_method(rb_cNumeric, "divmod", num_divmod, 1);
|
||||
rb_define_method(rb_cNumeric, "remainder", num_remainder, 1);
|
||||
rb_define_method(rb_cNumeric, "abs", num_abs, 0);
|
||||
|
||||
rb_define_method(rb_cNumeric, "integer?", num_int_p, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue