Ruby 1.9.3 Reference Manual > All Libraries > Builtin Library > class Rational > /
self / other -> Rational | Floatquo(other) -> Rational | Float商を計算します。
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