mod static method

BigInt mod(
  1. BigInt a, [
  2. BigInt? b
])

Mod division

Implementation

static BigInt mod(BigInt a, [BigInt? b]) {
  b ??= P;
  final r = a % b;
  if (r >= BigInt.zero) {
    return r;
  }
  return b + r;
}