summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-15 04:42:19 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-15 04:42:19 +0000
commitf663441bb5a85b69c8c177177bf52ef5d92372b8 (patch)
tree54865ef42b86302290bb1a3d8149912fd9e232df /rational.c
parent269503b544247b5b3e30dbe60a0bab4f2ca00e4e (diff)
downloadruby-f663441bb5a85b69c8c177177bf52ef5d92372b8.tar.gz
* 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
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/rational.c b/rational.c
index 652f5ace09..8155c5a0f0 100644
--- a/rational.c
+++ b/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();