pub trait CeilingDivAssignNegMod<RHS = Self> {
    type ModOutput;

    // Required method
    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§

source

fn ceiling_div_assign_neg_mod(&mut self, other: RHS) -> Self::ModOutput

Implementations on Foreign Types§

source§

impl CeilingDivAssignNegMod for u8

source§

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

source§

impl CeilingDivAssignNegMod for u16

source§

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

source§

impl CeilingDivAssignNegMod for u32

source§

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

source§

impl CeilingDivAssignNegMod for u64

source§

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

source§

impl CeilingDivAssignNegMod for u128

source§

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

source§

impl CeilingDivAssignNegMod for usize

source§

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.

§

type ModOutput = usize

Implementors§