diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-21 18:48:58 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-21 18:48:58 +0000 |
| commit | 2d5ddce2ac8f8b187397743d71bef4c399f83dbe (patch) | |
| tree | 6edefae6c56ef50b55a4ef0795f29adf35e181a6 /numeric.c | |
| parent | c3bc723ef68d354007f1057c092c4b843f38a0b8 (diff) | |
| download | ruby-2d5ddce2ac8f8b187397743d71bef4c399f83dbe.tar.gz ruby-2d5ddce2ac8f8b187397743d71bef4c399f83dbe.tar.xz ruby-2d5ddce2ac8f8b187397743d71bef4c399f83dbe.zip | |
* numeric.c (num_equal): should not use rb_equal().
* object.c (rb_equal): back out the last change.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
| -rw-r--r-- | numeric.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -57,7 +57,7 @@ #define DBL_EPSILON 2.2204460492503131e-16 #endif -static ID id_coerce, id_to_i; +static ID id_coerce, id_to_i, id_eq; VALUE rb_cNumeric; VALUE rb_cFloat; @@ -515,7 +515,8 @@ static VALUE num_equal(x, y) VALUE x, y; { - return rb_equal(y, x); + if (x == y) return Qtrue; + return rb_funcall(y, id_eq, 1, x); } static VALUE @@ -1804,6 +1805,7 @@ Init_Numeric() #endif id_coerce = rb_intern("coerce"); id_to_i = rb_intern("to_i"); + id_eq = rb_intern("=="); rb_eZeroDivError = rb_define_class("ZeroDivisionError", rb_eStandardError); rb_eFloatDomainError = rb_define_class("FloatDomainError", rb_eRangeError); |
