public BigInteger modInverse (BigInteger m)

Returns a BigInteger whose value is (this-1 mod m).

Parameters:
m    the modulus.

Returns:  this-1 mod m.

Exceptions:
ArithmeticException    m ≤ 0, or this BigInteger has no multiplicative inverse mod m (that is, this BigInteger is not relatively prime to m).