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