pub trait ModAddMulAssign<Y = Self, Z = Self, M = Self> {
// Required method
fn mod_add_mul_assign(&mut self, y: Y, z: Z, m: M);
}Expand description
Adds the product of two numbers to a number modulo a fourth number $m$, in place. All three inputs must be already reduced modulo $m$.
Required Methods§
fn mod_add_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 ModAddMulAssign for u8
impl ModAddMulAssign for u8
Source§fn mod_add_mul_assign(&mut self, y: u8, z: u8, m: u8)
fn mod_add_mul_assign(&mut self, y: u8, z: u8, m: u8)
Adds the product of two numbers to 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 ModAddMulAssign for u16
impl ModAddMulAssign for u16
Source§fn mod_add_mul_assign(&mut self, y: u16, z: u16, m: u16)
fn mod_add_mul_assign(&mut self, y: u16, z: u16, m: u16)
Adds the product of two numbers to 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 ModAddMulAssign for u32
impl ModAddMulAssign for u32
Source§fn mod_add_mul_assign(&mut self, y: u32, z: u32, m: u32)
fn mod_add_mul_assign(&mut self, y: u32, z: u32, m: u32)
Adds the product of two numbers to 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 ModAddMulAssign for u64
impl ModAddMulAssign for u64
Source§fn mod_add_mul_assign(&mut self, y: u64, z: u64, m: u64)
fn mod_add_mul_assign(&mut self, y: u64, z: u64, m: u64)
Adds the product of two numbers to 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 ModAddMulAssign for u128
impl ModAddMulAssign for u128
Source§fn mod_add_mul_assign(&mut self, y: u128, z: u128, m: u128)
fn mod_add_mul_assign(&mut self, y: u128, z: u128, m: u128)
Adds the product of two numbers to 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 ModAddMulAssign for usize
impl ModAddMulAssign for usize
Source§fn mod_add_mul_assign(&mut self, y: usize, z: usize, m: usize)
fn mod_add_mul_assign(&mut self, y: usize, z: usize, m: usize)
Adds the product of two numbers to 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.