Trait malachite_base::num::arithmetic::traits::ModPowerOf2SubAssign
source · [−]pub trait ModPowerOf2SubAssign<RHS = Self> {
fn mod_power_of_2_sub_assign(&mut self, other: RHS, pow: u64);
}
Expand description
Subtracts two numbers modulo $2^k$, in place. Assumes the inputs are already reduced modulo $2^k$.
Required Methods
fn mod_power_of_2_sub_assign(&mut self, other: RHS, pow: u64)
Implementations on Foreign Types
sourceimpl ModPowerOf2SubAssign<u8> for u8
impl ModPowerOf2SubAssign<u8> for u8
sourcefn mod_power_of_2_sub_assign(&mut self, other: u8, pow: u64)
fn mod_power_of_2_sub_assign(&mut self, other: u8, pow: u64)
Subtracts two numbers modulo a third number $2^k$, in place. Assumes the inputs are 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
.
Examples
See here.
sourceimpl ModPowerOf2SubAssign<u16> for u16
impl ModPowerOf2SubAssign<u16> for u16
sourcefn mod_power_of_2_sub_assign(&mut self, other: u16, pow: u64)
fn mod_power_of_2_sub_assign(&mut self, other: u16, pow: u64)
Subtracts two numbers modulo a third number $2^k$, in place. Assumes the inputs are 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
.
Examples
See here.
sourceimpl ModPowerOf2SubAssign<u32> for u32
impl ModPowerOf2SubAssign<u32> for u32
sourcefn mod_power_of_2_sub_assign(&mut self, other: u32, pow: u64)
fn mod_power_of_2_sub_assign(&mut self, other: u32, pow: u64)
Subtracts two numbers modulo a third number $2^k$, in place. Assumes the inputs are 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
.
Examples
See here.
sourceimpl ModPowerOf2SubAssign<u64> for u64
impl ModPowerOf2SubAssign<u64> for u64
sourcefn mod_power_of_2_sub_assign(&mut self, other: u64, pow: u64)
fn mod_power_of_2_sub_assign(&mut self, other: u64, pow: u64)
Subtracts two numbers modulo a third number $2^k$, in place. Assumes the inputs are 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
.
Examples
See here.
sourceimpl ModPowerOf2SubAssign<u128> for u128
impl ModPowerOf2SubAssign<u128> for u128
sourcefn mod_power_of_2_sub_assign(&mut self, other: u128, pow: u64)
fn mod_power_of_2_sub_assign(&mut self, other: u128, pow: u64)
Subtracts two numbers modulo a third number $2^k$, in place. Assumes the inputs are 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
.
Examples
See here.
sourceimpl ModPowerOf2SubAssign<usize> for usize
impl ModPowerOf2SubAssign<usize> for usize
sourcefn mod_power_of_2_sub_assign(&mut self, other: usize, pow: u64)
fn mod_power_of_2_sub_assign(&mut self, other: usize, pow: u64)
Subtracts two numbers modulo a third number $2^k$, in place. Assumes the inputs are 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
.
Examples
See here.