Trait malachite_base::num::arithmetic::traits::ModSubAssign
source · [−]pub trait ModSubAssign<RHS = Self, M = Self> {
fn mod_sub_assign(&mut self, other: RHS, m: M);
}
Expand description
Adds two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
Required Methods
fn mod_sub_assign(&mut self, other: RHS, m: M)
Implementations on Foreign Types
sourceimpl ModSubAssign<u8, u8> for u8
impl ModSubAssign<u8, u8> for u8
sourcefn mod_sub_assign(&mut self, other: u8, m: u8)
fn mod_sub_assign(&mut self, other: u8, m: u8)
Subtracts two numbers modulo a third number $m$, in place. Assumes the inputs are 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.
Examples
See here.
This is equivalent to nmod_sub
from nmod_vec.h
, FLINT 2.7.1, where the result
is assigned to a
.
sourceimpl ModSubAssign<u16, u16> for u16
impl ModSubAssign<u16, u16> for u16
sourcefn mod_sub_assign(&mut self, other: u16, m: u16)
fn mod_sub_assign(&mut self, other: u16, m: u16)
Subtracts two numbers modulo a third number $m$, in place. Assumes the inputs are 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.
Examples
See here.
This is equivalent to nmod_sub
from nmod_vec.h
, FLINT 2.7.1, where the result
is assigned to a
.
sourceimpl ModSubAssign<u32, u32> for u32
impl ModSubAssign<u32, u32> for u32
sourcefn mod_sub_assign(&mut self, other: u32, m: u32)
fn mod_sub_assign(&mut self, other: u32, m: u32)
Subtracts two numbers modulo a third number $m$, in place. Assumes the inputs are 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.
Examples
See here.
This is equivalent to nmod_sub
from nmod_vec.h
, FLINT 2.7.1, where the result
is assigned to a
.
sourceimpl ModSubAssign<u64, u64> for u64
impl ModSubAssign<u64, u64> for u64
sourcefn mod_sub_assign(&mut self, other: u64, m: u64)
fn mod_sub_assign(&mut self, other: u64, m: u64)
Subtracts two numbers modulo a third number $m$, in place. Assumes the inputs are 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.
Examples
See here.
This is equivalent to nmod_sub
from nmod_vec.h
, FLINT 2.7.1, where the result
is assigned to a
.
sourceimpl ModSubAssign<u128, u128> for u128
impl ModSubAssign<u128, u128> for u128
sourcefn mod_sub_assign(&mut self, other: u128, m: u128)
fn mod_sub_assign(&mut self, other: u128, m: u128)
Subtracts two numbers modulo a third number $m$, in place. Assumes the inputs are 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.
Examples
See here.
This is equivalent to nmod_sub
from nmod_vec.h
, FLINT 2.7.1, where the result
is assigned to a
.
sourceimpl ModSubAssign<usize, usize> for usize
impl ModSubAssign<usize, usize> for usize
sourcefn mod_sub_assign(&mut self, other: usize, m: usize)
fn mod_sub_assign(&mut self, other: usize, m: usize)
Subtracts two numbers modulo a third number $m$, in place. Assumes the inputs are 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.
Examples
See here.
This is equivalent to nmod_sub
from nmod_vec.h
, FLINT 2.7.1, where the result
is assigned to a
.