modulusBig function

BigInt modulusBig (BigInt dividend, BigInt divisor)

Canonical Modulus. The result has the sign of the divisor.

Implementation

BigInt modulusBig(BigInt dividend, BigInt divisor) =>
    ((dividend % divisor) + divisor) % divisor;