るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.065秒)
トップページ > クラス:Numeric[x] > クエリ:_builtin[x] > クエリ:numeric[x] > クエリ:eql?[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Numeric#eql?(other) -> bool (35113.0)

自身と other のクラスが等しくかつ == メソッドで比較して等しい場合に true を返します。 そうでない場合に false を返します。

...ます。

Numeric
のサブクラスは、eql? で比較して等しい数値同士が同じハッシュ値を返すように
hash メソッドを適切に定義する必要があります。

@param other 自身と比較したい数値を指定します。

//emlist[例][ruby]{
p 1.eql?(1) #=>...
...true
p 1.eql?(1.0) #=> false
p 1 == 1.0 #=> true
//}

@see Object#equal?, Object#eql?, Object#==, Object#===...