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