Trait malachite_base::num::arithmetic::traits::ModSubAssign

source ·
pub trait ModSubAssign<RHS = Self, M = Self> {
    // Required method
    fn mod_sub_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_sub_assign(&mut self, other: RHS, m: M)

Implementations on Foreign Types§

source§

impl ModSubAssign for u8

source§

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

Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModSubAssign for u16

source§

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

Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModSubAssign for u32

source§

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

Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModSubAssign for u64

source§

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

Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModSubAssign for u128

source§

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

Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is assigned to a.

source§

impl ModSubAssign for usize

source§

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

Subtracts 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_sub from nmod.h, FLINT 2.7.1, where the result is assigned to a.

Implementors§