# File lib/rational.rb, line 173 def * (a) if a.kind_of?(Rational) num = @numerator * a.numerator den = @denominator * a.denominator Rational(num, den) elsif a.kind_of?(Integer) self * Rational.new!(a, 1) elsif a.kind_of?(Float) Float(self) * a else x, y = a.coerce(self) x * y end end