AdvancedIntegerMathPowMod Method |
Computes a power of an integer in modular arithmetic.
Namespace:
Meta.Numerics.Functions
Assembly:
Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax public static int PowMod(
int b,
int e,
int m
)
Public Shared Function PowMod (
b As Integer,
e As Integer,
m As Integer
) As Integer
public:
static int PowMod(
int b,
int e,
int m
)
static member PowMod :
b : int *
e : int *
m : int -> int
Parameters
- b
- Type: SystemInt32
The base, which must be positive. - e
- Type: SystemInt32
The exponent, which must be positive. - m
- Type: SystemInt32
The modulus, which must be positive.
Return Value
Type:
Int32The value of b
e mod m.
Exceptions Remarks Modular exponentiation is used in many number-theory applications, including
primality testing, prime factorization, and cryptography.
See Also