= private = protected
to_i()
Converts the rational to an Integer. Not the nearest integer, the truncated integer. Study the following example carefully:
Rational(+7,4).to_i # -> 1 Rational(-7,4).to_i # -> -2 (-1.75).to_i # -> -1
In other words:
Rational(-7,4) == -1.75 # -> true Rational(-7,4).to_i == (-1.75).to_i # false
# File lib/rational.rb, line 350 def to_i Integer(@numerator.div(@denominator)) end