Big Integer.Modular Pow Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
Modular | Raises a number to a power modulo another number. |
Modular | Raises a number to a power modulo another number. |
ModularPow(BigInteger, BigInteger, BigInteger)
Raises a number to a power modulo another number.
public static BigInteger ModularPow(
BigInteger value,
BigInteger exponent,
BigInteger modulus
)
Parameters
- value BigInteger
- The number to raise to a power.
- exponent BigInteger
- The exponent.
- modulus BigInteger
- The modulus.
Return Value
BigIntegervalue raised to the power exponent modulo modulus.
ModularPow(BigInteger, Int32, BigInteger)
Raises a number to a power modulo another number.
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
BigIntegervalue 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.