Programming, Scala, Data Type, Abstraction, Introduction.
r.denominator + r.numerator * denominator, denominator * r.denominator) def multiply(r: Rational) = // ... def divide(r: Rational) = // ... } Now, for the results of these operations to be useful we would expect that we are given the simplified version of the rational number which means we are