summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
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;
}