Skip to content

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

instance method

BigDecimal#eql?

eql?(p1)

Alias of #==

Tests for value equality; returns true if the values are equal.

The == and === operators and the eql? method have the same implementation for BigDecimal.

Values may be coerced to perform the comparison:

Example
BigDecimal('1.0') == 1.0  #=> true
See also #== #dup #exponent #_dump also in 3.3 · 3.2 · 3.0