summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bignum.c b/bignum.c
index a969fd2e0c..f5ec1fe015 100644
--- a/bignum.c
+++ b/bignum.c
@@ -962,10 +962,13 @@ rb_big_eq(x, y)
case T_BIGNUM:
break;
case T_FLOAT:
- if (rb_big2dbl(x) == RFLOAT(y)->value)
- return Qtrue;
- else
- return Qfalse;
+ {
+ double a, b;
+
+ a = RFLOAT(y)->value;
+ b = rb_big2dbl(x);
+ return (a == b)?Qtrue:Qfalse;
+ }
default:
return rb_equal(y, x);
}