method
round
round()
public
Hide source
# File lib/rational.rb, line 373 def round() if @numerator < 0 num = -@numerator num = num * 2 + @denominator den = @denominator * 2 -(num.div(den)) else num = @numerator * 2 + @denominator den = @denominator * 2 num.div(den) end end