summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-15 13:39:18 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-15 13:39:18 +0000
commit04388f9f9dae3dc6af0ff7b30495760a8dc352b4 (patch)
treec714abc0693bc4748980c9379bea04dbd68568ca /bignum.c
parentc6cb57262d244a1e888807d9e85eed57bb447558 (diff)
* bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return
-HUGE_VAL (-Infinity). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23695 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 398d963aea..123eca7403 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1233,7 +1233,10 @@ rb_big2dbl(VALUE x)
if (isinf(d)) {
rb_warning("Bignum out of Float range");
- d = HUGE_VAL;
+ if (signbit(d))
+ d = -HUGE_VAL;
+ else
+ d = HUGE_VAL;
}
return d;
}