Trait SaturatingMulAssign

Source
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§