Ruby 2.5.0 リファレンスマニュアル > ライブラリ一覧 > bigdecimalライブラリ > BigDecimalクラス > ==

instance method BigDecimal#==

self == other -> bool[permalink][rdoc]
self === other -> bool
eql?(other) -> bool

self が other と等しい場合に true を、そうでない場合に false を返します。

それぞれの値は BigDecimal#coerce で変換して比較される場合があります。


require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true