instance method Rational#/
self / other -> Rational | Float
-
商を計算します。
- [PARAM] other:
- 自身を割る数
other に Float を指定した場合は、計算結果を Float で返しま す。
例:
Rational(3, 4) / 2 # => Rational(3, 8) Rational(3, 4) / Rational(2, 1) # => Rational(3, 8) Rational(3, 4) / 2.0 # => 0.375 Rational(3, 4) / 0 # => ZeroDivisionError
- [EXCEPTION] ZeroDivisionError:
- other が 0 の時に発生します。
class Rational