mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
5d6602c44e
commit
228f30be3a
7 changed files with 27 additions and 89 deletions
21
rational.c
21
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))
|
||||
|
@ -817,18 +813,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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue