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)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
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.