operator % method

Rational operator %(
  1. Rational other
)

Implementation

Rational operator %(Rational other) {
  final remainder = this.remainder(other);
  if (remainder == _r0) return _r0;
  return remainder + (isNegative ? other.abs() : _r0);
}