positiveMod static method

BigInt positiveMod(
  1. BigInt a,
  2. BigInt b
)

Calculates the positive remainder of two BigInt values.

Implementation

static BigInt positiveMod(BigInt a, BigInt b) {
  final result = a % b;
  return result >= BigInt.zero ? result : b + result;
}