Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > rationalライブラリ > Rationalクラス > div

instance method Rational#div

div(other) -> Integer

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

[PARAM] other:
自身を割る数

例:

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