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§

source

fn mod_neg_assign(&mut self, m: M)

Implementations on Foreign Types§

source§

impl ModNegAssign for u8

source§

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_vec.h, FLINT 2.7.1, where the output is assigned to a.

source§

impl ModNegAssign for u16

source§

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_vec.h, FLINT 2.7.1, where the output is assigned to a.

source§

impl ModNegAssign for u32

source§

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_vec.h, FLINT 2.7.1, where the output is assigned to a.

source§

impl ModNegAssign for u64

source§

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_vec.h, FLINT 2.7.1, where the output is assigned to a.

source§

impl ModNegAssign for u128

source§

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_vec.h, FLINT 2.7.1, where the output is assigned to a.

source§

impl ModNegAssign for usize

source§

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_vec.h, FLINT 2.7.1, where the output is assigned to a.

Implementors§