## 17.3 Simple Arithmetic Operators - Fraction Example

a/b + c/d is defined to be (a*d + c*d)/(b*d)

>     Fraction operator+(const Fraction& left, const Fraction& right)
>     {
>        Fraction result(left.numerator() * right.denominator()
>           + right.numerator() * left.denominator(),
>           left.denominator() * right.denominator());
>        return result;
>     }

The remaining operations are defined similarly

prev |top |next