るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.125秒)

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric eql?
  4. numeric real?
  5. numeric ceil

ライブラリ

クラス

検索結果

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

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

自身と 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?, ...