pub trait ModPowerOf2PowAssign<RHS = Self> {
    // Required method
    fn mod_power_of_2_pow_assign(&mut self, exp: RHS, pow: u64);
}
Expand description

Raises a number to a power modulo $2^k$, in place. The base must be already reduced modulo $2^k$.

Required Methods§

source

fn mod_power_of_2_pow_assign(&mut self, exp: RHS, pow: u64)

Implementations on Foreign Types§

source§

impl ModPowerOf2PowAssign for u64

source§

fn mod_power_of_2_pow_assign(&mut self, exp: u64, pow: u64)

Raises a number to a power modulo another number $2^k$, in place. The base must be already reduced modulo $2^k$.

$x \gets 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 or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2PowAssign<u64> for u8

source§

fn mod_power_of_2_pow_assign(&mut self, exp: u64, pow: u64)

Raises a number to a power modulo another number $2^k$, in place. The base must be already reduced modulo $2^k$.

$x \gets 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 or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2PowAssign<u64> for u16

source§

fn mod_power_of_2_pow_assign(&mut self, exp: u64, pow: u64)

Raises a number to a power modulo another number $2^k$, in place. The base must be already reduced modulo $2^k$.

$x \gets 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 or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2PowAssign<u64> for u32

source§

fn mod_power_of_2_pow_assign(&mut self, exp: u64, pow: u64)

Raises a number to a power modulo another number $2^k$, in place. The base must be already reduced modulo $2^k$.

$x \gets 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 or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2PowAssign<u64> for u128

source§

fn mod_power_of_2_pow_assign(&mut self, exp: u64, pow: u64)

Raises a number to a power modulo another number $2^k$, in place. The base must be already reduced modulo $2^k$.

$x \gets 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 or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2PowAssign<u64> for usize

source§

fn mod_power_of_2_pow_assign(&mut self, exp: u64, pow: u64)

Raises a number to a power modulo another number $2^k$, in place. The base must be already reduced modulo $2^k$.

$x \gets 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 or if self is greater than or equal to $2^k$.

§Examples

See here.

Implementors§