summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 097b928e34..ef628f4f21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jun 15 22:35:31 2009 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return
+ -HUGE_VAL (-Infinity).
+
Mon Jun 15 18:48:41 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (argf_each_line): should return self. [ruby-core:23852]
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;
}