remainder method

Rat remainder(
  1. Rat other
)

Returns the remainder of this Rat divided by other.

Implementation

Rat remainder(Rat other) {
  return Rat(n.remainder(d * other.n), d * other.d);
}