BigInteger.ModularPow(BigInteger, Int32, BigInteger) Method

Raises a number to a power modulo another number.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static BigInteger ModularPow(
	BigInteger value,
	int exponent,
	BigInteger modulus
)

Parameters

value  BigInteger
The number to raise to a power.
exponent  Int32
The exponent.
modulus  BigInteger
The modulus.

Return Value

BigInteger
value raised to the power exponent modulo modulus.

Remarks

Negative values for the exponent are allowed. When exponent is equal to -1, the modular inverse is returned.

See Also