summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:15:52 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:15:52 +0000
commit745dcf0915a0de05c1f4b8d167ce7bf8c214dfc2 (patch)
treeb1a7ebaaa4a776cf68afb5b17ef4430085a11a43 /bignum.c
parent8eb441fda64f083b7a3105347384c89c42899e45 (diff)
merges r23695 and r23698 from trunk into ruby_1_9_1.
-- * bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return -HUGE_VAL (-Infinity). -- avoid signbit() and adjust indentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23789 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 5a608774e7..eb021b801f 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1213,7 +1213,10 @@ rb_big2dbl(VALUE x)
if (isinf(d)) {
rb_warning("Bignum out of Float range");
- d = HUGE_VAL;
+ if (d < 0.0)
+ d = -HUGE_VAL;
+ else
+ d = HUGE_VAL;
}
return d;
}