mod method

BigInt mod(
  1. BigInt m
)

Implementation

BigInt mod(BigInt m) {
  BigInt r = this % m;
  return r.isNegative ? r + m : r;
}