This documentation is archived and is not being maintained.
BigInteger::ModPow Method
Visual Studio 2010
Performs modulus division on a number raised to the power of another number.
Assembly: System.Numerics (in System.Numerics.dll)
public: static BigInteger ModPow( BigInteger value, BigInteger exponent, BigInteger modulus )
Parameters
- value
- Type: System.Numerics::BigInteger
The number to raise to the exponent power.
- exponent
- Type: System.Numerics::BigInteger
The exponent to raise value by.
- modulus
- Type: System.Numerics::BigInteger
The number by which to divide value raised to the exponent power.
| Exception | Condition |
|---|---|
| DivideByZeroException | modulus is zero. |
| ArgumentOutOfRangeException | exponent is negative. |
The ModPow method evaluates the following expression:
(baseValue ^ exponent) Mod modulus
To perform exponentiation on BigInteger values without modulus division, use the Pow method.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: