Trait malachite_base::num::arithmetic::traits::CeilingDivAssignMod
source · [−]pub trait CeilingDivAssignMod<RHS = Self> {
type ModOutput;
fn ceiling_div_assign_mod(&mut self, other: RHS) -> Self::ModOutput;
}
Expand description
Divides a number by another number in place, taking the quotient and returning the remainder. The quotient is rounded towards positive infinity and the remainder has the opposite sign of the divisor (second input).
The quotient and remainder satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
Required Associated Types
Required Methods
fn ceiling_div_assign_mod(&mut self, other: RHS) -> Self::ModOutput
Implementations on Foreign Types
sourceimpl CeilingDivAssignMod<i8> for i8
impl CeilingDivAssignMod<i8> for i8
sourcefn ceiling_div_assign_mod(&mut self, other: i8) -> i8
fn ceiling_div_assign_mod(&mut self, other: i8) -> i8
Divides a number by another number in place, returning the remainder. The quotient is rounded towards positive infinity and the remainder has the opposite sign as the second number.
The quotient and remainder satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ f(x, y) = x - y\left \lceil\frac{x}{y} \right \rceil, $$ $$ x \gets \left \lceil \frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0, or if self
is $t::MIN
and other
is -1.
Examples
See here.
type ModOutput = i8
sourceimpl CeilingDivAssignMod<i16> for i16
impl CeilingDivAssignMod<i16> for i16
sourcefn ceiling_div_assign_mod(&mut self, other: i16) -> i16
fn ceiling_div_assign_mod(&mut self, other: i16) -> i16
Divides a number by another number in place, returning the remainder. The quotient is rounded towards positive infinity and the remainder has the opposite sign as the second number.
The quotient and remainder satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ f(x, y) = x - y\left \lceil\frac{x}{y} \right \rceil, $$ $$ x \gets \left \lceil \frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0, or if self
is $t::MIN
and other
is -1.
Examples
See here.
type ModOutput = i16
sourceimpl CeilingDivAssignMod<i32> for i32
impl CeilingDivAssignMod<i32> for i32
sourcefn ceiling_div_assign_mod(&mut self, other: i32) -> i32
fn ceiling_div_assign_mod(&mut self, other: i32) -> i32
Divides a number by another number in place, returning the remainder. The quotient is rounded towards positive infinity and the remainder has the opposite sign as the second number.
The quotient and remainder satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ f(x, y) = x - y\left \lceil\frac{x}{y} \right \rceil, $$ $$ x \gets \left \lceil \frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0, or if self
is $t::MIN
and other
is -1.
Examples
See here.
type ModOutput = i32
sourceimpl CeilingDivAssignMod<i64> for i64
impl CeilingDivAssignMod<i64> for i64
sourcefn ceiling_div_assign_mod(&mut self, other: i64) -> i64
fn ceiling_div_assign_mod(&mut self, other: i64) -> i64
Divides a number by another number in place, returning the remainder. The quotient is rounded towards positive infinity and the remainder has the opposite sign as the second number.
The quotient and remainder satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ f(x, y) = x - y\left \lceil\frac{x}{y} \right \rceil, $$ $$ x \gets \left \lceil \frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0, or if self
is $t::MIN
and other
is -1.
Examples
See here.
type ModOutput = i64
sourceimpl CeilingDivAssignMod<i128> for i128
impl CeilingDivAssignMod<i128> for i128
sourcefn ceiling_div_assign_mod(&mut self, other: i128) -> i128
fn ceiling_div_assign_mod(&mut self, other: i128) -> i128
Divides a number by another number in place, returning the remainder. The quotient is rounded towards positive infinity and the remainder has the opposite sign as the second number.
The quotient and remainder satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ f(x, y) = x - y\left \lceil\frac{x}{y} \right \rceil, $$ $$ x \gets \left \lceil \frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0, or if self
is $t::MIN
and other
is -1.
Examples
See here.
type ModOutput = i128
sourceimpl CeilingDivAssignMod<isize> for isize
impl CeilingDivAssignMod<isize> for isize
sourcefn ceiling_div_assign_mod(&mut self, other: isize) -> isize
fn ceiling_div_assign_mod(&mut self, other: isize) -> isize
Divides a number by another number in place, returning the remainder. The quotient is rounded towards positive infinity and the remainder has the opposite sign as the second number.
The quotient and remainder satisfy $x = qy + r$ and $0 \leq |r| < |y|$.
$$ f(x, y) = x - y\left \lceil\frac{x}{y} \right \rceil, $$ $$ x \gets \left \lceil \frac{x}{y} \right \rceil. $$
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is 0, or if self
is $t::MIN
and other
is -1.
Examples
See here.