mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* rational.c (nurat_div): reverted r28844, r28886 and r28887.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
269503b544
commit
f663441bb5
2 changed files with 5 additions and 12 deletions
|
@ -1,3 +1,7 @@
|
|||
Sun Sep 15 13:31:23 2013 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* rational.c (nurat_div): reverted r28844, r28886 and r28887.
|
||||
|
||||
Sat Sep 14 06:08:10 2013 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* dir.c (dir_s_glob): [DOC] Improve wording and layout.
|
||||
|
|
13
rational.c
13
rational.c
|
@ -952,19 +952,8 @@ nurat_div(VALUE self, VALUE other)
|
|||
other, ONE, '/');
|
||||
}
|
||||
}
|
||||
else if (RB_TYPE_P(other, T_FLOAT)) {
|
||||
{
|
||||
double x = RFLOAT_VALUE(other), den;
|
||||
get_dat1(self);
|
||||
|
||||
if (isnan(x)) return DBL2NUM(NAN);
|
||||
if (isinf(x)) return INT2FIX(0);
|
||||
if (x != 0.0 && modf(x, &den) == 0.0) {
|
||||
return rb_rational_raw2(dat->num, f_mul(rb_dbl2big(den), dat->den));
|
||||
}
|
||||
}
|
||||
else if (RB_TYPE_P(other, T_FLOAT))
|
||||
return rb_funcall(f_to_f(self), '/', 1, other);
|
||||
}
|
||||
else if (RB_TYPE_P(other, T_RATIONAL)) {
|
||||
if (f_zero_p(other))
|
||||
rb_raise_zerodiv();
|
||||
|
|
Loading…
Reference in a new issue