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