pub trait ModSubMulAssign<Y = Self, Z = Self, M = Self> {
// Required method
fn mod_sub_mul_assign(&mut self, y: Y, z: Z, m: M);
}Expand description
Subtracts the product of two numbers from a number modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
Required Methods§
fn mod_sub_mul_assign(&mut self, y: Y, z: Z, m: M)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ModSubMulAssign for u8
impl ModSubMulAssign for u8
Source§fn mod_sub_mul_assign(&mut self, y: u8, z: u8, m: u8)
fn mod_sub_mul_assign(&mut self, y: u8, z: u8, m: u8)
Subtracts the product of two numbers from a third number, modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
$x \gets w$, where $x, y, z, w < m$ and $x - yz \equiv w \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self, y, or z are greater than or equal to m.
§Examples
See here.
Source§impl ModSubMulAssign for u16
impl ModSubMulAssign for u16
Source§fn mod_sub_mul_assign(&mut self, y: u16, z: u16, m: u16)
fn mod_sub_mul_assign(&mut self, y: u16, z: u16, m: u16)
Subtracts the product of two numbers from a third number, modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
$x \gets w$, where $x, y, z, w < m$ and $x - yz \equiv w \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self, y, or z are greater than or equal to m.
§Examples
See here.
Source§impl ModSubMulAssign for u32
impl ModSubMulAssign for u32
Source§fn mod_sub_mul_assign(&mut self, y: u32, z: u32, m: u32)
fn mod_sub_mul_assign(&mut self, y: u32, z: u32, m: u32)
Subtracts the product of two numbers from a third number, modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
$x \gets w$, where $x, y, z, w < m$ and $x - yz \equiv w \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self, y, or z are greater than or equal to m.
§Examples
See here.
Source§impl ModSubMulAssign for u64
impl ModSubMulAssign for u64
Source§fn mod_sub_mul_assign(&mut self, y: u64, z: u64, m: u64)
fn mod_sub_mul_assign(&mut self, y: u64, z: u64, m: u64)
Subtracts the product of two numbers from a third number, modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
$x \gets w$, where $x, y, z, w < m$ and $x - yz \equiv w \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self, y, or z are greater than or equal to m.
§Examples
See here.
Source§impl ModSubMulAssign for u128
impl ModSubMulAssign for u128
Source§fn mod_sub_mul_assign(&mut self, y: u128, z: u128, m: u128)
fn mod_sub_mul_assign(&mut self, y: u128, z: u128, m: u128)
Subtracts the product of two numbers from a third number, modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
$x \gets w$, where $x, y, z, w < m$ and $x - yz \equiv w \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self, y, or z are greater than or equal to m.
§Examples
See here.
Source§impl ModSubMulAssign for usize
impl ModSubMulAssign for usize
Source§fn mod_sub_mul_assign(&mut self, y: usize, z: usize, m: usize)
fn mod_sub_mul_assign(&mut self, y: usize, z: usize, m: usize)
Subtracts the product of two numbers from a third number, modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
$x \gets w$, where $x, y, z, w < m$ and $x - yz \equiv w \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self, y, or z are greater than or equal to m.
§Examples
See here.