operator % method

Rat operator %(
  1. Rat other
)

Returns the modulo of this Rat and other.

Implementation

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