Trait malachite_base::num::arithmetic::traits::CeilingModAssign
source · [−]pub trait CeilingModAssign<RHS = Self> {
fn ceiling_mod_assign(&mut self, other: RHS);
}
Expand description
Divides a number by another number, replacing the first number by the remainder. The remainder has the same sign as the divisor (second number).
If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
Required Methods
fn ceiling_mod_assign(&mut self, other: RHS)
Implementations on Foreign Types
sourceimpl CeilingModAssign<i8> for i8
impl CeilingModAssign<i8> for i8
sourcefn ceiling_mod_assign(&mut self, other: i8)
fn ceiling_mod_assign(&mut self, other: i8)
Divides a number by another number, replacing the first number by the remainder. The remainder has the opposite sign as the second number.
If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ x \gets x - y\left \lceil\frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl CeilingModAssign<i16> for i16
impl CeilingModAssign<i16> for i16
sourcefn ceiling_mod_assign(&mut self, other: i16)
fn ceiling_mod_assign(&mut self, other: i16)
Divides a number by another number, replacing the first number by the remainder. The remainder has the opposite sign as the second number.
If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ x \gets x - y\left \lceil\frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl CeilingModAssign<i32> for i32
impl CeilingModAssign<i32> for i32
sourcefn ceiling_mod_assign(&mut self, other: i32)
fn ceiling_mod_assign(&mut self, other: i32)
Divides a number by another number, replacing the first number by the remainder. The remainder has the opposite sign as the second number.
If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ x \gets x - y\left \lceil\frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl CeilingModAssign<i64> for i64
impl CeilingModAssign<i64> for i64
sourcefn ceiling_mod_assign(&mut self, other: i64)
fn ceiling_mod_assign(&mut self, other: i64)
Divides a number by another number, replacing the first number by the remainder. The remainder has the opposite sign as the second number.
If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ x \gets x - y\left \lceil\frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl CeilingModAssign<i128> for i128
impl CeilingModAssign<i128> for i128
sourcefn ceiling_mod_assign(&mut self, other: i128)
fn ceiling_mod_assign(&mut self, other: i128)
Divides a number by another number, replacing the first number by the remainder. The remainder has the opposite sign as the second number.
If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ x \gets x - y\left \lceil\frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.
sourceimpl CeilingModAssign<isize> for isize
impl CeilingModAssign<isize> for isize
sourcefn ceiling_mod_assign(&mut self, other: isize)
fn ceiling_mod_assign(&mut self, other: isize)
Divides a number by another number, replacing the first number by the remainder. The remainder has the opposite sign as the second number.
If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ x \gets x - y\left \lceil\frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0.
Examples
See here.