Trait malachite_base::num::arithmetic::traits::SaturatingMulAssign
source · [−]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
fn saturating_mul_assign(&mut self, other: RHS)
Implementations on Foreign Types
sourceimpl SaturatingMulAssign<u8> for u8
impl SaturatingMulAssign<u8> for u8
sourcefn saturating_mul_assign(&mut self, other: u8)
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.
sourceimpl SaturatingMulAssign<u16> for u16
impl SaturatingMulAssign<u16> for u16
sourcefn saturating_mul_assign(&mut self, other: u16)
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.
sourceimpl SaturatingMulAssign<u32> for u32
impl SaturatingMulAssign<u32> for u32
sourcefn saturating_mul_assign(&mut self, other: u32)
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.
sourceimpl SaturatingMulAssign<u64> for u64
impl SaturatingMulAssign<u64> for u64
sourcefn saturating_mul_assign(&mut self, other: u64)
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.
sourceimpl SaturatingMulAssign<u128> for u128
impl SaturatingMulAssign<u128> for u128
sourcefn saturating_mul_assign(&mut self, other: u128)
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.
sourceimpl SaturatingMulAssign<usize> for usize
impl SaturatingMulAssign<usize> for usize
sourcefn saturating_mul_assign(&mut self, other: usize)
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.
sourceimpl SaturatingMulAssign<i8> for i8
impl SaturatingMulAssign<i8> for i8
sourcefn saturating_mul_assign(&mut self, other: i8)
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.
sourceimpl SaturatingMulAssign<i16> for i16
impl SaturatingMulAssign<i16> for i16
sourcefn saturating_mul_assign(&mut self, other: i16)
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.
sourceimpl SaturatingMulAssign<i32> for i32
impl SaturatingMulAssign<i32> for i32
sourcefn saturating_mul_assign(&mut self, other: i32)
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.
sourceimpl SaturatingMulAssign<i64> for i64
impl SaturatingMulAssign<i64> for i64
sourcefn saturating_mul_assign(&mut self, other: i64)
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.
sourceimpl SaturatingMulAssign<i128> for i128
impl SaturatingMulAssign<i128> for i128
sourcefn saturating_mul_assign(&mut self, other: i128)
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.
sourceimpl SaturatingMulAssign<isize> for isize
impl SaturatingMulAssign<isize> for isize
sourcefn saturating_mul_assign(&mut self, other: isize)
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.