summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-06 05:47:45 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-06 05:47:45 +0000
commit1acfb03370704aee624b7a1e5ccf4776f40f2895 (patch)
treee213362ebb3e05b012f699f215a2c4795ce9ecd3 /bignum.c
parent996e9cf4e9c78c4bf8fdbf937f3984e0b2eb6e40 (diff)
merge revision(s) 28324:
* bignum.c (rb_big2dbl), test/ruby/test_bignum.rb (test_to_f): A negative Bignum out of Float range should be converted to -Infinity. [ruby-core:30492] [Bug #3362] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@35941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 77697ae4fa..6c0bf651da 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1069,7 +1069,10 @@ rb_big2dbl(x)
if (isinf(d)) {
rb_warn("Bignum out of Float range");
- d = HUGE_VAL;
+ if (d < 0.0)
+ d = -HUGE_VAL;
+ else
+ d = HUGE_VAL;
}
return d;
}