diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-04 04:17:26 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-04 04:17:26 +0000 |
commit | 4f51d814183316c3e97da1dc13cf6945b5a76f2f (patch) | |
tree | 3ab2686a359f6cbdda8446d7382f9aa541c2490a /numeric.c | |
parent | 5a8bfc39f132708bcf3ee2970e9f55ee6d101b65 (diff) |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 8 |
1 files changed, 4 insertions, 4 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); |