pub trait ModAddAssign<RHS = Self, M = Self> {
// Required method
fn mod_add_assign(&mut self, other: RHS, m: M);
}Expand description
Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.
Required Methods§
fn mod_add_assign(&mut self, other: RHS, 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 ModAddAssign for u8
impl ModAddAssign for u8
Source§fn mod_add_assign(&mut self, other: u8, m: u8)
fn mod_add_assign(&mut self, other: u8, m: u8)
Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.
$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self or other are greater than or equal to m.
§Examples
See here.
This is equivalent to nmod_add from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModAddAssign for u16
impl ModAddAssign for u16
Source§fn mod_add_assign(&mut self, other: u16, m: u16)
fn mod_add_assign(&mut self, other: u16, m: u16)
Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.
$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self or other are greater than or equal to m.
§Examples
See here.
This is equivalent to nmod_add from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModAddAssign for u32
impl ModAddAssign for u32
Source§fn mod_add_assign(&mut self, other: u32, m: u32)
fn mod_add_assign(&mut self, other: u32, m: u32)
Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.
$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self or other are greater than or equal to m.
§Examples
See here.
This is equivalent to nmod_add from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModAddAssign for u64
impl ModAddAssign for u64
Source§fn mod_add_assign(&mut self, other: u64, m: u64)
fn mod_add_assign(&mut self, other: u64, m: u64)
Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.
$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self or other are greater than or equal to m.
§Examples
See here.
This is equivalent to nmod_add from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModAddAssign for u128
impl ModAddAssign for u128
Source§fn mod_add_assign(&mut self, other: u128, m: u128)
fn mod_add_assign(&mut self, other: u128, m: u128)
Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.
$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self or other are greater than or equal to m.
§Examples
See here.
This is equivalent to nmod_add from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModAddAssign for usize
impl ModAddAssign for usize
Source§fn mod_add_assign(&mut self, other: usize, m: usize)
fn mod_add_assign(&mut self, other: usize, m: usize)
Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.
$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if self or other are greater than or equal to m.
§Examples
See here.
This is equivalent to nmod_add from nmod.h, FLINT 2.7.1, where the result is
assigned to a.