pub trait Mod<RHS = Self> {
    type Output;

    fn mod_op(self, other: RHS) -> Self::Output;
}
Expand description

Divides a number by another number, returning just the remainder. The remainder has the same sign as the divisor (second number).

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.

Required Associated Types

Required Methods

Implementations on Foreign Types

Divides a number by another number, returning just the remainder.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq r < y$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq r < y$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq r < y$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq r < y$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq r < y$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq r < y$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder. The remainder has the same sign as the second number.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder. The remainder has the same sign as the second number.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder. The remainder has the same sign as the second number.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder. The remainder has the same sign as the second number.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder. The remainder has the same sign as the second number.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Divides a number by another number, returning just the remainder. The remainder has the same sign as the second number.

If the quotient were computed, the quotient and remainder would satisfy $x = qy + r$ and $0 \leq |r| < |y|$.

$$ f(x, y) = x - y\left \lfloor \frac{x}{y} \right \rfloor. $$

This function is called mod_op rather than mod because mod is a Rust keyword.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if other is 0.

Examples

See here.

Implementors