aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index 71e33470fd..132b611be1 100644
--- a/bignum.c
+++ b/bignum.c
@@ -798,6 +798,7 @@ rb_big2dbl(x)
while (i--) {
d = ds[i] + BIGRAD*d;
}
+ if (isinf(d)) d = HUGE_VAL;
if (!RBIGNUM(x)->sign) d = -d;
return d;
}
@@ -855,6 +856,8 @@ static VALUE
rb_big_eq(x, y)
VALUE x, y;
{
+ double d;
+
switch (TYPE(y)) {
case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));