summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 92384bf8e3..35b79d8877 100644
--- a/bignum.c
+++ b/bignum.c
@@ -966,10 +966,11 @@ rb_big_eq(x, y)
break;
case T_FLOAT:
{
- double a, b;
+ volatile double a, b;
a = RFLOAT(y)->value;
b = rb_big2dbl(x);
+ if (isnan(a) || isnan(b)) return Qfalse;
return (a == b)?Qtrue:Qfalse;
}
default: