Trait malachite_base::num::arithmetic::traits::CeilingDivNegMod
source · pub trait CeilingDivNegMod<RHS = Self> {
type DivOutput;
type ModOutput;
// Required method
fn ceiling_div_neg_mod(
self,
other: RHS,
) -> (Self::DivOutput, Self::ModOutput);
}
Expand description
Divides a number by another number, returning the ceiling of the quotient and 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_neg_mod(self, other: RHS) -> (Self::DivOutput, Self::ModOutput)
Implementations on Foreign Types§
source§impl CeilingDivNegMod for u8
impl CeilingDivNegMod for u8
source§fn ceiling_div_neg_mod(self, other: u8) -> (u8, u8)
fn ceiling_div_neg_mod(self, other: u8) -> (u8, u8)
Divides a number by another number, returning the ceiling of the quotient and 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) = \left ( \left \lceil \frac{x}{y} \right \rceil, \space y\left \lceil \frac{x}{y} \right \rceil - x \right ). $$
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if other
is 0.
§Examples
See here.
type DivOutput = u8
type ModOutput = u8
source§impl CeilingDivNegMod for u16
impl CeilingDivNegMod for u16
source§fn ceiling_div_neg_mod(self, other: u16) -> (u16, u16)
fn ceiling_div_neg_mod(self, other: u16) -> (u16, u16)
Divides a number by another number, returning the ceiling of the quotient and 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) = \left ( \left \lceil \frac{x}{y} \right \rceil, \space y\left \lceil \frac{x}{y} \right \rceil - x \right ). $$
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if other
is 0.
§Examples
See here.
type DivOutput = u16
type ModOutput = u16
source§impl CeilingDivNegMod for u32
impl CeilingDivNegMod for u32
source§fn ceiling_div_neg_mod(self, other: u32) -> (u32, u32)
fn ceiling_div_neg_mod(self, other: u32) -> (u32, u32)
Divides a number by another number, returning the ceiling of the quotient and 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) = \left ( \left \lceil \frac{x}{y} \right \rceil, \space y\left \lceil \frac{x}{y} \right \rceil - x \right ). $$
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if other
is 0.
§Examples
See here.
type DivOutput = u32
type ModOutput = u32
source§impl CeilingDivNegMod for u64
impl CeilingDivNegMod for u64
source§fn ceiling_div_neg_mod(self, other: u64) -> (u64, u64)
fn ceiling_div_neg_mod(self, other: u64) -> (u64, u64)
Divides a number by another number, returning the ceiling of the quotient and 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) = \left ( \left \lceil \frac{x}{y} \right \rceil, \space y\left \lceil \frac{x}{y} \right \rceil - x \right ). $$
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if other
is 0.
§Examples
See here.
type DivOutput = u64
type ModOutput = u64
source§impl CeilingDivNegMod for u128
impl CeilingDivNegMod for u128
source§fn ceiling_div_neg_mod(self, other: u128) -> (u128, u128)
fn ceiling_div_neg_mod(self, other: u128) -> (u128, u128)
Divides a number by another number, returning the ceiling of the quotient and 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) = \left ( \left \lceil \frac{x}{y} \right \rceil, \space y\left \lceil \frac{x}{y} \right \rceil - x \right ). $$
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if other
is 0.
§Examples
See here.
type DivOutput = u128
type ModOutput = u128
source§impl CeilingDivNegMod for usize
impl CeilingDivNegMod for usize
source§fn ceiling_div_neg_mod(self, other: usize) -> (usize, usize)
fn ceiling_div_neg_mod(self, other: usize) -> (usize, usize)
Divides a number by another number, returning the ceiling of the quotient and 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) = \left ( \left \lceil \frac{x}{y} \right \rceil, \space y\left \lceil \frac{x}{y} \right \rceil - x \right ). $$
§Worst-case complexity
Constant time and additional memory.
§Panics
Panics if other
is 0.
§Examples
See here.