operator <= method

bool operator <=(
  1. Rat other
)

Whether this Rat is less or equal to other.

Implementation

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