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