pub trait SaturatingSubMulAssign<Y = Self, Z = Self> {
    fn saturating_sub_mul_assign(&mut self, y: Y, z: Z);
}
Expand description

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

Required Methods

Implementations on Foreign Types

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Subtracts a number by the product of two other numbers in place, saturating at the numeric bounds instead of overflowing.

$$ x \gets \begin{cases} x - yz & \text{if} \quad m \leq x - yz \leq M, \\ M & \text{if} \quad x - yz > M, \\ m & \text{if} \quad x - yz < 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