Trait malachite_base::num::arithmetic::traits::ModNeg
source · [−]Expand description
Negates a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
Required Associated Types
Required Methods
Implementations on Foreign Types
sourceimpl ModNeg<u8> for u8
impl ModNeg<u8> for u8
sourcefn mod_neg(self, m: u8) -> u8
fn mod_neg(self, m: u8) -> u8
Negates a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$f(x, m) = 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.
type Output = u8
sourceimpl ModNeg<u16> for u16
impl ModNeg<u16> for u16
sourcefn mod_neg(self, m: u16) -> u16
fn mod_neg(self, m: u16) -> u16
Negates a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$f(x, m) = 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.
type Output = u16
sourceimpl ModNeg<u32> for u32
impl ModNeg<u32> for u32
sourcefn mod_neg(self, m: u32) -> u32
fn mod_neg(self, m: u32) -> u32
Negates a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$f(x, m) = 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.
type Output = u32
sourceimpl ModNeg<u64> for u64
impl ModNeg<u64> for u64
sourcefn mod_neg(self, m: u64) -> u64
fn mod_neg(self, m: u64) -> u64
Negates a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$f(x, m) = 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.
type Output = u64
sourceimpl ModNeg<u128> for u128
impl ModNeg<u128> for u128
sourcefn mod_neg(self, m: u128) -> u128
fn mod_neg(self, m: u128) -> u128
Negates a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$f(x, m) = 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.
type Output = u128
sourceimpl ModNeg<usize> for usize
impl ModNeg<usize> for usize
sourcefn mod_neg(self, m: usize) -> usize
fn mod_neg(self, m: usize) -> usize
Negates a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$f(x, m) = 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.