summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-06 11:12:35 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-06 11:12:35 (GMT)
commitedd4332a3803fa30b4624371c1cc37fe75d19ff4 (patch)
treecc0f941631e7e4142554d8719cdd14c833df6114 /rational.c
parent8aa6059dbfcf840b9e7870ca9639194e707b05a0 (diff)
* rational.c (nurat_div): divided by float zero should be
infinity. [ruby-core:31626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rational.c b/rational.c
index 6e3b396..d732f8d 100644
--- a/rational.c
+++ b/rational.c
@@ -882,7 +882,7 @@ nurat_div(VALUE self, VALUE other)
return DBL2NUM(-INFINITY);
}
}
- if (modf(x, &den) == 0.0) {
+ if (x != 0.0 && modf(x, &den) == 0.0) {
return rb_rational_raw2(dat->num, f_mul(rb_dbl2big(den), dat->den));
}
}