pub trait SaturatingSubMulAssign<Y = Self, Z = Self> {
    // Required method
    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§

source

fn saturating_sub_mul_assign(&mut self, y: Y, z: Z)

Implementations on Foreign Types§

source§

impl SaturatingSubMulAssign for i8

source§

fn saturating_sub_mul_assign(&mut self, y: i8, z: i8)

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.

source§

impl SaturatingSubMulAssign for i16

source§

fn saturating_sub_mul_assign(&mut self, y: i16, z: i16)

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.

source§

impl SaturatingSubMulAssign for i32

source§

fn saturating_sub_mul_assign(&mut self, y: i32, z: i32)

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.

source§

impl SaturatingSubMulAssign for i64

source§

fn saturating_sub_mul_assign(&mut self, y: i64, z: i64)

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.

source§

impl SaturatingSubMulAssign for i128

source§

fn saturating_sub_mul_assign(&mut self, y: i128, z: i128)

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.

source§

impl SaturatingSubMulAssign for isize

source§

fn saturating_sub_mul_assign(&mut self, y: isize, z: isize)

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.

source§

impl SaturatingSubMulAssign for u8

source§

fn saturating_sub_mul_assign(&mut self, y: u8, z: u8)

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.

source§

impl SaturatingSubMulAssign for u16

source§

fn saturating_sub_mul_assign(&mut self, y: u16, z: u16)

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.

source§

impl SaturatingSubMulAssign for u32

source§

fn saturating_sub_mul_assign(&mut self, y: u32, z: u32)

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.

source§

impl SaturatingSubMulAssign for u64

source§

fn saturating_sub_mul_assign(&mut self, y: u64, z: u64)

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.

source§

impl SaturatingSubMulAssign for u128

source§

fn saturating_sub_mul_assign(&mut self, y: u128, z: u128)

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.

source§

impl SaturatingSubMulAssign for usize

source§

fn saturating_sub_mul_assign(&mut self, y: usize, z: usize)

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§