pub trait ModSubAssign<RHS = Self, M = Self> {
// Required method
fn mod_sub_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_sub_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 ModSubAssign for u8
impl ModSubAssign for u8
Source§fn mod_sub_assign(&mut self, other: u8, m: u8)
fn mod_sub_assign(&mut self, other: u8, m: u8)
Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModSubAssign for u16
impl ModSubAssign for u16
Source§fn mod_sub_assign(&mut self, other: u16, m: u16)
fn mod_sub_assign(&mut self, other: u16, m: u16)
Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModSubAssign for u32
impl ModSubAssign for u32
Source§fn mod_sub_assign(&mut self, other: u32, m: u32)
fn mod_sub_assign(&mut self, other: u32, m: u32)
Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModSubAssign for u64
impl ModSubAssign for u64
Source§fn mod_sub_assign(&mut self, other: u64, m: u64)
fn mod_sub_assign(&mut self, other: u64, m: u64)
Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModSubAssign for u128
impl ModSubAssign for u128
Source§fn mod_sub_assign(&mut self, other: u128, m: u128)
fn mod_sub_assign(&mut self, other: u128, m: u128)
Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is
assigned to a.
Source§impl ModSubAssign for usize
impl ModSubAssign for usize
Source§fn mod_sub_assign(&mut self, other: usize, m: usize)
fn mod_sub_assign(&mut self, other: usize, m: usize)
Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is
assigned to a.