summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-16 06:38:28 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-16 06:38:28 +0000
commit8d0b1c25189fd0b52590b14c128999ebc650ac05 (patch)
treeedb4c284e5c3191245de5dde3df6598d178345cf /bignum.c
parent6dd65bb3776eca2335e90ffd7a81b641d6404ce2 (diff)
* bignum.c (rb_big_eq): use rb_big_float_cmp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/bignum.c b/bignum.c
index 839a866ae9..592c8f88ce 100644
--- a/bignum.c
+++ b/bignum.c
@@ -1616,14 +1616,7 @@ rb_big_eq(VALUE x, VALUE y)
case T_BIGNUM:
break;
case T_FLOAT:
- {
- volatile double a, b;
-
- a = RFLOAT_VALUE(y);
- if (isnan(a) || isinf(a)) return Qfalse;
- b = rb_big2dbl(x);
- return (a == b)?Qtrue:Qfalse;
- }
+ return rb_big_float_cmp(x, y) == INT2FIX(0) ? Qtrue : Qfalse;
default:
return rb_equal(y, x);
}