diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-06 11:12:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-06 11:12:35 +0000 |
commit | edd4332a3803fa30b4624371c1cc37fe75d19ff4 (patch) | |
tree | cc0f941631e7e4142554d8719cdd14c833df6114 /rational.c | |
parent | 8aa6059dbfcf840b9e7870ca9639194e707b05a0 (diff) | |
download | ruby-edd4332a3803fa30b4624371c1cc37fe75d19ff4.tar.gz |
* 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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rational.c b/rational.c index 6e3b39639d..d732f8d8a7 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)); } } |