operator % method

BigRational operator %(
  1. BigRational other
)

Computes the remainder of dividing this BigRational by the given BigRational and returns the result.

other The divisor BigRational. returns A new BigRational representing the remainder of the division operation.

Implementation

BigRational operator %(BigRational other) {
  BigRational re = remainder(other);
  if (isNegative) {
    re += other.abs();
  }
  return re;
}