eql and == are different : eql « Class « Ruby






eql and == are different


1 == 1.0    # true: Fixnum and Float objects can be ==
1.eql?(1.0) # false: but they are never eql!

 

Related examples in the same category

1.Use === to compare values