pub trait SaturatingMulAssign<RHS = Self> {
    fn saturating_mul_assign(&mut self, other: RHS);
}
Expand description

Multiplies a number by another number in place, saturating at the numeric bounds instead of overflowing.

Required Methods

Implementations on Foreign Types

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Multiplies a number by another number, in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} xy & \text{if} \quad m \leq xy \leq M, \\ M & \text{if} \quad xy > M, \\ m & \text{if} \quad xy < m, \end{cases} $$ where $m$ is Self::MIN and $M$ is Self::MAX.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors