diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-18 13:11:09 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-18 13:11:09 +0000 |
commit | babea6b33eb4d2f06542e9ed34e717f60c1b2c94 (patch) | |
tree | c76c83dd68c73c2d16dcddbf6393d40869169897 /numeric.c | |
parent | f7c0ed81c460e0ef4f21a74ebc67fc529efd25c3 (diff) | |
download | ruby-babea6b33eb4d2f06542e9ed34e717f60c1b2c94.tar.gz |
* bignum.c (Bignum#eql?): remove its definition because it is unified
with Numeric#eql?.
* numeric.c (num_eql): treat Bignum values directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1112,11 +1112,13 @@ flo_pow(VALUE x, VALUE y) * num.eql?(numeric) -> true or false * * Returns +true+ if +num+ and +numeric+ are the same type and have equal - * values. + * values. Contrast this with <code>Numeric#==</code>, which performs + * type conversions. * * 1 == 1.0 #=> true * 1.eql?(1.0) #=> false * (1.0).eql?(1.0) #=> true + * 68719476736.eql?(68719476736.0) #=> false */ static VALUE @@ -1124,6 +1126,10 @@ num_eql(VALUE x, VALUE y) { if (TYPE(x) != TYPE(y)) return Qfalse; + if (RB_TYPE_P(x, T_BIGNUM)) { + return rb_big_eql(x, y); + } + return rb_equal(x, y); } |