Fix `Float#eql?`
MODIFY
src/numeric.c
src/numeric.c
@@ -369,7 +369,7 @@ flo_eql(mrb_state *mrb, mrb_value x)
mrb_get_args(mrb, "o", &y);
if (!mrb_float_p(y)) return mrb_false_value();
- return mrb_bool_value(mrb_float(x) == (mrb_float)mrb_fixnum(y));
+ return mrb_bool_value(mrb_float(x) == mrb_float(y));
}
/* 15.2.9.3.7 */

MODIFY
test/t/float.rb
test/t/float.rb
@@ -239,4 +239,10 @@ assert('Float#to_s') do
end
end
+assert('Float#eql?') do
+ assert_true(5.0.eql?(5.0))
+ assert_false(5.0.eql?(5))
+ assert_false(5.0.eql?("5.0"))
+end
+
end # const_defined?(:Float)

Fix `Float#eql?`