modPow

fun modPow(exponent: BigInteger, m: BigInteger): BigInteger

Returns a BigInteger whose value is (this<sup>exponent</sup> rem m). (Unlike pow, this method permits negative exponents.)

Return

this<sup>exponent</sup> rem m

See also

.modInverse

Parameters

exponent

the exponent.

m

the modulus.

Throws

m 0 or the exponent is negative and this BigInteger is not relatively prime to m.