diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-31 10:14:42 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-31 10:14:42 +0000 |
commit | 4aa2d7c25d7557a77ff87ea3d8a7349edc33807c (patch) | |
tree | 122bbc971d37cb761b214645e2e0b9b4414eab6f /numeric.c | |
parent | d682b47684d0a7d775ff7d849ecce08d1b530a25 (diff) | |
download | ruby-4aa2d7c25d7557a77ff87ea3d8a7349edc33807c.tar.gz ruby-4aa2d7c25d7557a77ff87ea3d8a7349edc33807c.tar.xz ruby-4aa2d7c25d7557a77ff87ea3d8a7349edc33807c.zip |
* numeric.c (num_quo): should convert its operand to Rational.
* rational.c (string_to_r_strict): should raise TypeError.
* bignum.c (Init_Bignum): should not redefine Bignum#div.
Numeric#div will do. [ruby-dev:34066]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -257,7 +257,7 @@ num_uminus(VALUE num) static VALUE num_quo(VALUE x, VALUE y) { - return rb_funcall(x, '/', 1, y); + return rb_funcall(x, '/', 1, rb_Rational1(y)); } @@ -275,7 +275,7 @@ static VALUE num_floor(VALUE num); static VALUE num_div(VALUE x, VALUE y) { - return num_floor(rb_funcall(x, '/', 1, y)); + return rb_funcall(rb_funcall(x, '/', 1, y), rb_intern("floor"), 0, 0); } |