public BigInteger mod (BigInteger m)

Returns a BigInteger whose value is (this mod m). This method differs from remainder in that it always returns a non-negative BigInteger.

Parameters:
m    the modulus.

Returns:  this mod m

Exceptions:
ArithmeticException    m ≤ 0

See also:
remainder