instance method Rational#==
self == other -> bool
-
数値として等しいか判定します。
- [PARAM] other:
- 自身と比較する数値
- [RETURN]
- self と other が等しい場合 true を返します。 そうでなければ false を返します。
例:
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
class Rational