summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-03 16:01:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-03 16:01:16 +0000
commit228f30be3a96d078179eb1e1773a226c50c4e1a2 (patch)
tree5425f2861bd8fed40999a2c21659821f500fc826 /rational.c
parent5d6602c44e95862d28e05591798d790d0ad80dfb (diff)
* bignum.c (Init_Bignum): rdiv method removed. [ruby-dev:34242]
* complex.c (nucomp_quo): ditto. * numeric.c (num_rdiv): ditto. * rational.c (nurat_div): ditto. * complex.c (nucomp_fdiv): fdiv implementation restored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/rational.c b/rational.c
index fe7ec37b8d..de5c7867c3 100644
--- a/rational.c
+++ b/rational.c
@@ -781,7 +781,7 @@ nurat_mul(VALUE self, VALUE other)
#define f_to_r(x) rb_funcall(x, id_to_r, 0)
static VALUE
-nurat_division(VALUE self, VALUE other, int rdiv)
+nurat_div(VALUE self, VALUE other)
{
again:
switch (TYPE(other)) {
@@ -797,10 +797,6 @@ nurat_division(VALUE self, VALUE other, int rdiv)
other, ONE, '/');
}
case T_FLOAT:
- if (rdiv) {
- other = f_to_r(other);
- goto again;
- }
return rb_funcall(f_to_f(self), '/', 1, other);
case T_RATIONAL:
if (f_zero_p(other))
@@ -818,18 +814,6 @@ nurat_division(VALUE self, VALUE other, int rdiv)
}
static VALUE
-nurat_div(VALUE self, VALUE other)
-{
- return nurat_division(self, other, Qfalse);
-}
-
-static VALUE
-nurat_rdiv(VALUE self, VALUE other)
-{
- return nurat_division(self, other, Qtrue);
-}
-
-static VALUE
nurat_fdiv(VALUE self, VALUE other)
{
return f_div(f_to_f(self), other);
@@ -1549,8 +1533,7 @@ Init_Rational(void)
rb_define_method(rb_cRational, "-", nurat_sub, 1);
rb_define_method(rb_cRational, "*", nurat_mul, 1);
rb_define_method(rb_cRational, "/", nurat_div, 1);
- rb_define_method(rb_cRational, "quo", nurat_rdiv, 1);
- rb_define_method(rb_cRational, "rdiv", nurat_rdiv, 1);
+ rb_define_method(rb_cRational, "quo", nurat_div, 1);
rb_define_method(rb_cRational, "fdiv", nurat_fdiv, 1);
rb_define_method(rb_cRational, "**", nurat_expt, 1);