pub trait SaturatingMulAssign<RHS = Self> {
    // Required method
    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§

source

fn saturating_mul_assign(&mut self, other: RHS)

Implementations on Foreign Types§

source§

impl SaturatingMulAssign for i8

source§

fn saturating_mul_assign(&mut self, other: i8)

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.

source§

impl SaturatingMulAssign for i16

source§

fn saturating_mul_assign(&mut self, other: i16)

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.

source§

impl SaturatingMulAssign for i32

source§

fn saturating_mul_assign(&mut self, other: i32)

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.

source§

impl SaturatingMulAssign for i64

source§

fn saturating_mul_assign(&mut self, other: i64)

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.

source§

impl SaturatingMulAssign for i128

source§

fn saturating_mul_assign(&mut self, other: i128)

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.

source§

impl SaturatingMulAssign for isize

source§

fn saturating_mul_assign(&mut self, other: isize)

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.

source§

impl SaturatingMulAssign for u8

source§

fn saturating_mul_assign(&mut self, other: u8)

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.

source§

impl SaturatingMulAssign for u16

source§

fn saturating_mul_assign(&mut self, other: u16)

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.

source§

impl SaturatingMulAssign for u32

source§

fn saturating_mul_assign(&mut self, other: u32)

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.

source§

impl SaturatingMulAssign for u64

source§

fn saturating_mul_assign(&mut self, other: u64)

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.

source§

impl SaturatingMulAssign for u128

source§

fn saturating_mul_assign(&mut self, other: u128)

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.

source§

impl SaturatingMulAssign for usize

source§

fn saturating_mul_assign(&mut self, other: usize)

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§