Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Float#eql?

float.eql?(obj) → true or false

Returns true only if obj is a Float with the same value as float. Contrast this with Float#==, which performs type conversions.

Example
1.0.eql?(1)   #=> false

The result of NaN.eql?(NaN) is undefined, so an implementation-dependent value is returned.

See also #divmod #fdiv #denominator #finite? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1