Ruby 1.8.7 Reference Manual > All Libraries > library rational > class Rational > div

instance method Rational#div

div(other) -> Integer

self を other で割った整数の商を返します。

[PARAM] other:
自身を割る数

例:

Rational(1, 2).div(Rational(2, 3)) # => 0