summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-31 10:14:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-31 10:14:42 +0000
commit88a4961cb2bf52186d188bb8feaed9465c8acddc (patch)
tree122bbc971d37cb761b214645e2e0b9b4414eab6f /numeric.c
parentb2acbb2c67e8d9dc5eaf4823f5e547c57832c443 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@15866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numeric.c b/numeric.c
index fc2310b..85565bf 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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);
}