# Trait malachite_base::num::arithmetic::traits::ModPowerOf2Pow

pub trait ModPowerOf2Pow<RHS = Self> {
type Output;

fn mod_power_of_2_pow(self, exp: RHS, pow: u64) -> Self::Output;
}
Expand description

Raises a number to a power modulo $2^k$. Assumes the input is already reduced modulo $2^k$.

## Implementations on Foreign Types

Raises a number to a power modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

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

##### 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().

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Raises a number to a power modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

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

##### 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().

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Raises a number to a power modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

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

##### 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().

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Raises a number to a power modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

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

##### 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().

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Raises a number to a power modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

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

##### 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().

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Raises a number to a power modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

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

##### 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().

##### Panics

Panics if pow is greater than Self::WIDTH.

See here.