pub trait ModAddAssign<RHS = Self, M = Self> {
    // Required method
    fn mod_add_assign(&mut self, other: RHS, m: M);
}
Expand description

Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.

Required Methods§

source

fn mod_add_assign(&mut self, other: RHS, m: M)

Implementations on Foreign Types§

source§

impl ModAddAssign for u8

source§

fn mod_add_assign(&mut self, other: u8, m: u8)

Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.

$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self or other are greater than or equal to m.

§Examples

See here.

This is equivalent to nmod_add from nmod_vec.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModAddAssign for u16

source§

fn mod_add_assign(&mut self, other: u16, m: u16)

Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.

$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self or other are greater than or equal to m.

§Examples

See here.

This is equivalent to nmod_add from nmod_vec.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModAddAssign for u32

source§

fn mod_add_assign(&mut self, other: u32, m: u32)

Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.

$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self or other are greater than or equal to m.

§Examples

See here.

This is equivalent to nmod_add from nmod_vec.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModAddAssign for u64

source§

fn mod_add_assign(&mut self, other: u64, m: u64)

Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.

$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self or other are greater than or equal to m.

§Examples

See here.

This is equivalent to nmod_add from nmod_vec.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModAddAssign for u128

source§

fn mod_add_assign(&mut self, other: u128, m: u128)

Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.

$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self or other are greater than or equal to m.

§Examples

See here.

This is equivalent to nmod_add from nmod_vec.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModAddAssign for usize

source§

fn mod_add_assign(&mut self, other: usize, m: usize)

Adds two numbers modulo a third number $m$, in place. The inputs must be already reduced modulo $m$.

$x \gets z$, where $x, y, z < m$ and $x + y \equiv z \mod m$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self or other are greater than or equal to m.

§Examples

See here.

This is equivalent to nmod_add from nmod_vec.h, FLINT 2.7.1, where the result is assigned to a.

Implementors§