pub trait ModNegAssign<M = Self> {
// Required method
fn mod_neg_assign(&mut self, m: M);
}Expand description
Negates a number modulo another number $m$, in place. The input must be already reduced modulo $m$.
Required Methods§
fn mod_neg_assign(&mut self, 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 ModNegAssign for u8
impl ModNegAssign for u8
Source§fn mod_neg_assign(&mut self, m: u8)
fn mod_neg_assign(&mut self, m: u8)
Negates a number modulo another number $m$. The input must be already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $-x \equiv y \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to nmod_neg from nmod.h, FLINT 2.7.1, where the output is
assigned to a.
Source§impl ModNegAssign for u16
impl ModNegAssign for u16
Source§fn mod_neg_assign(&mut self, m: u16)
fn mod_neg_assign(&mut self, m: u16)
Negates a number modulo another number $m$. The input must be already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $-x \equiv y \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to nmod_neg from nmod.h, FLINT 2.7.1, where the output is
assigned to a.
Source§impl ModNegAssign for u32
impl ModNegAssign for u32
Source§fn mod_neg_assign(&mut self, m: u32)
fn mod_neg_assign(&mut self, m: u32)
Negates a number modulo another number $m$. The input must be already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $-x \equiv y \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to nmod_neg from nmod.h, FLINT 2.7.1, where the output is
assigned to a.
Source§impl ModNegAssign for u64
impl ModNegAssign for u64
Source§fn mod_neg_assign(&mut self, m: u64)
fn mod_neg_assign(&mut self, m: u64)
Negates a number modulo another number $m$. The input must be already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $-x \equiv y \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to nmod_neg from nmod.h, FLINT 2.7.1, where the output is
assigned to a.
Source§impl ModNegAssign for u128
impl ModNegAssign for u128
Source§fn mod_neg_assign(&mut self, m: u128)
fn mod_neg_assign(&mut self, m: u128)
Negates a number modulo another number $m$. The input must be already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $-x \equiv y \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to nmod_neg from nmod.h, FLINT 2.7.1, where the output is
assigned to a.
Source§impl ModNegAssign for usize
impl ModNegAssign for usize
Source§fn mod_neg_assign(&mut self, m: usize)
fn mod_neg_assign(&mut self, m: usize)
Negates a number modulo another number $m$. The input must be already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $-x \equiv y \mod m$.
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to nmod_neg from nmod.h, FLINT 2.7.1, where the output is
assigned to a.