Trait malachite_base::num::arithmetic::traits::NegModAssign
source · [−]pub trait NegModAssign<RHS = Self> {
fn neg_mod_assign(&mut self, other: RHS);
}
Expand description
Divides the negative of a number by another number, replacing the first number by the remainder.
If the quotient were computed, the quotient and remainder would satisfy $x = qy - r$ and $0 \leq r < y$.
Required Methods
fn neg_mod_assign(&mut self, other: RHS)
Implementations on Foreign Types
sourceimpl NegModAssign<u8> for u8
impl NegModAssign<u8> for u8
sourcefn neg_mod_assign(&mut self, other: u8)
fn neg_mod_assign(&mut self, other: u8)
Divides the negative of a number by another number, returning just the remainder.
If the quotient were computed, the quotient and remainder would satisfy $x = qy - r$ and $0 \leq r < y$.
$$ x \gets y\left \lceil \frac{x}{y} \right \rceil - x. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl NegModAssign<u16> for u16
impl NegModAssign<u16> for u16
sourcefn neg_mod_assign(&mut self, other: u16)
fn neg_mod_assign(&mut self, other: u16)
Divides the negative of a number by another number, returning just the remainder.
If the quotient were computed, the quotient and remainder would satisfy $x = qy - r$ and $0 \leq r < y$.
$$ x \gets y\left \lceil \frac{x}{y} \right \rceil - x. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl NegModAssign<u32> for u32
impl NegModAssign<u32> for u32
sourcefn neg_mod_assign(&mut self, other: u32)
fn neg_mod_assign(&mut self, other: u32)
Divides the negative of a number by another number, returning just the remainder.
If the quotient were computed, the quotient and remainder would satisfy $x = qy - r$ and $0 \leq r < y$.
$$ x \gets y\left \lceil \frac{x}{y} \right \rceil - x. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl NegModAssign<u64> for u64
impl NegModAssign<u64> for u64
sourcefn neg_mod_assign(&mut self, other: u64)
fn neg_mod_assign(&mut self, other: u64)
Divides the negative of a number by another number, returning just the remainder.
If the quotient were computed, the quotient and remainder would satisfy $x = qy - r$ and $0 \leq r < y$.
$$ x \gets y\left \lceil \frac{x}{y} \right \rceil - x. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl NegModAssign<u128> for u128
impl NegModAssign<u128> for u128
sourcefn neg_mod_assign(&mut self, other: u128)
fn neg_mod_assign(&mut self, other: u128)
Divides the negative of a number by another number, returning just the remainder.
If the quotient were computed, the quotient and remainder would satisfy $x = qy - r$ and $0 \leq r < y$.
$$ x \gets y\left \lceil \frac{x}{y} \right \rceil - x. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl NegModAssign<usize> for usize
impl NegModAssign<usize> for usize
sourcefn neg_mod_assign(&mut self, other: usize)
fn neg_mod_assign(&mut self, other: usize)
Divides the negative of a number by another number, returning just the remainder.
If the quotient were computed, the quotient and remainder would satisfy $x = qy - r$ and $0 \leq r < y$.
$$ x \gets y\left \lceil \frac{x}{y} \right \rceil - x. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.