るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.209秒)
トップページ > バージョン:2.5.0[x] > クラス:Rational[x] > クエリ:_builtin[x] > クエリ:==[x]

別のキーワード

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

ライブラリ

検索結果

Rational#==(other) -> bool (78394.0)

数値として等しいか判定します。

...でなければ false を返します。

//emlist[例][ruby]{
Rational
(2, 3) == Rational(2, 3) # => true
Rational
(5) == 5 # => true
Rational
(0) == 0.0 # => true
Rational
('1/3') == 0.33 # => false
Rational
('1/2') == '1/2' # => false
//}...