Trait malachite_base::num::arithmetic::traits::ModNegAssign
source · [−]pub trait ModNegAssign<M = Self> {
fn mod_neg_assign(&mut self, m: M);
}
Expand description
Negates a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Required Methods
fn mod_neg_assign(&mut self, m: M)
Implementations on Foreign Types
sourceimpl ModNegAssign<u8> for u8
impl ModNegAssign<u8> for u8
sourcefn mod_neg_assign(&mut self, m: u8)
fn mod_neg_assign(&mut self, m: u8)
Negates a number modulo another number $m$. Assumes the input is 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_vec.h
, FLINT 2.7.1, where the output
is assigned to a
.
sourceimpl ModNegAssign<u16> for u16
impl ModNegAssign<u16> for u16
sourcefn mod_neg_assign(&mut self, m: u16)
fn mod_neg_assign(&mut self, m: u16)
Negates a number modulo another number $m$. Assumes the input is 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_vec.h
, FLINT 2.7.1, where the output
is assigned to a
.
sourceimpl ModNegAssign<u32> for u32
impl ModNegAssign<u32> for u32
sourcefn mod_neg_assign(&mut self, m: u32)
fn mod_neg_assign(&mut self, m: u32)
Negates a number modulo another number $m$. Assumes the input is 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_vec.h
, FLINT 2.7.1, where the output
is assigned to a
.
sourceimpl ModNegAssign<u64> for u64
impl ModNegAssign<u64> for u64
sourcefn mod_neg_assign(&mut self, m: u64)
fn mod_neg_assign(&mut self, m: u64)
Negates a number modulo another number $m$. Assumes the input is 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_vec.h
, FLINT 2.7.1, where the output
is assigned to a
.
sourceimpl ModNegAssign<u128> for u128
impl ModNegAssign<u128> for u128
sourcefn mod_neg_assign(&mut self, m: u128)
fn mod_neg_assign(&mut self, m: u128)
Negates a number modulo another number $m$. Assumes the input is 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_vec.h
, FLINT 2.7.1, where the output
is assigned to a
.
sourceimpl ModNegAssign<usize> for usize
impl ModNegAssign<usize> for usize
sourcefn mod_neg_assign(&mut self, m: usize)
fn mod_neg_assign(&mut self, m: usize)
Negates a number modulo another number $m$. Assumes the input is 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_vec.h
, FLINT 2.7.1, where the output
is assigned to a
.