operator < method

bool operator <(
  1. Rat other
)

Whether this Rat is less than other.

Implementation

bool operator <(Rat other) {
  return n * other.d < other.n * d;
}