Trait malachite_base::num::arithmetic::traits::ModNegAssign
source · 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)
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
.