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