# Trait malachite_base::num::arithmetic::traits::ModPow

pub trait ModPow<RHS = Self, M = Self> {
type Output;

fn mod_pow(self, exp: RHS, m: M) -> Self::Output;
}
Expand description

Raises a number to a power modulo another number $m$. Assumes the input is already reduced modulo $m$.

## Implementations on Foreign Types

Raises a number to a power modulo another number $m$. Assumes the input is already reduced modulo $m$.

$f(x, n, m) = y$, where $x, y < m$ and $x^n \equiv y \mod m$.

##### Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

##### Examples

See here.

Raises a number to a power modulo another number $m$. Assumes the input is already reduced modulo $m$.

$f(x, n, m) = y$, where $x, y < m$ and $x^n \equiv y \mod m$.

##### Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

##### Examples

See here.

Raises a number to a power modulo another number $m$. Assumes the input is already reduced modulo $m$.

$f(x, n, m) = y$, where $x, y < m$ and $x^n \equiv y \mod m$.

##### Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

##### Examples

See here.

Raises a number to a power modulo another number $m$. Assumes the input is already reduced modulo $m$.

$f(x, n, m) = y$, where $x, y < m$ and $x^n \equiv y \mod m$.

##### Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

##### Examples

See here.

Raises a number to a power modulo another number $m$. Assumes the input is already reduced modulo $m$.

$f(x, n, m) = y$, where $x, y < m$ and $x^n \equiv y \mod m$.

##### Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

##### Examples

See here.

Raises a number to a power modulo another number $m$. Assumes the input is already reduced modulo $m$.

$f(x, n, m) = y$, where $x, y < m$ and $x^n \equiv y \mod m$.

##### Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

See here.