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

Subtracts two numbers modulo $2^k$, in place. The inputs must be already reduced modulo $2^k$.

Required Methods§

source

fn mod_power_of_2_sub_assign(&mut self, other: RHS, pow: u64)

Implementations on Foreign Types§

source§

impl ModPowerOf2SubAssign for u8

source§

fn mod_power_of_2_sub_assign(&mut self, other: u8, pow: u64)

Subtracts two numbers modulo a third number $2^k$, in place. The inputs must be already reduced modulo $2^k$.

$x \gets z$, where $x, y, z < 2^k$ and $x - y \equiv z \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self or other are greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2SubAssign for u16

source§

fn mod_power_of_2_sub_assign(&mut self, other: u16, pow: u64)

Subtracts two numbers modulo a third number $2^k$, in place. The inputs must be already reduced modulo $2^k$.

$x \gets z$, where $x, y, z < 2^k$ and $x - y \equiv z \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self or other are greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2SubAssign for u32

source§

fn mod_power_of_2_sub_assign(&mut self, other: u32, pow: u64)

Subtracts two numbers modulo a third number $2^k$, in place. The inputs must be already reduced modulo $2^k$.

$x \gets z$, where $x, y, z < 2^k$ and $x - y \equiv z \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self or other are greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2SubAssign for u64

source§

fn mod_power_of_2_sub_assign(&mut self, other: u64, pow: u64)

Subtracts two numbers modulo a third number $2^k$, in place. The inputs must be already reduced modulo $2^k$.

$x \gets z$, where $x, y, z < 2^k$ and $x - y \equiv z \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self or other are greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2SubAssign for u128

source§

fn mod_power_of_2_sub_assign(&mut self, other: u128, pow: u64)

Subtracts two numbers modulo a third number $2^k$, in place. The inputs must be already reduced modulo $2^k$.

$x \gets z$, where $x, y, z < 2^k$ and $x - y \equiv z \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self or other are greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2SubAssign for usize

source§

fn mod_power_of_2_sub_assign(&mut self, other: usize, pow: u64)

Subtracts two numbers modulo a third number $2^k$, in place. The inputs must be already reduced modulo $2^k$.

$x \gets z$, where $x, y, z < 2^k$ and $x - y \equiv z \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self or other are greater than or equal to $2^k$.

§Examples

See here.

Implementors§