Trait malachite_base::num::arithmetic::traits::SaturatingPowAssign
source · [−]pub trait SaturatingPowAssign<RHS = Self> {
fn saturating_pow_assign(&mut self, exp: RHS);
}
Expand description
Raises a number to a power in place, saturating at the numeric bounds instead of overflowing.
Required Methods
fn saturating_pow_assign(&mut self, exp: RHS)
Implementations on Foreign Types
sourceimpl SaturatingPowAssign<u64> for u8
impl SaturatingPowAssign<u64> for u8
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for u16
impl SaturatingPowAssign<u64> for u16
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for u32
impl SaturatingPowAssign<u64> for u32
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for u64
impl SaturatingPowAssign<u64> for u64
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for u128
impl SaturatingPowAssign<u64> for u128
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for usize
impl SaturatingPowAssign<u64> for usize
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for i8
impl SaturatingPowAssign<u64> for i8
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for i16
impl SaturatingPowAssign<u64> for i16
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for i32
impl SaturatingPowAssign<u64> for i32
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for i64
impl SaturatingPowAssign<u64> for i64
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for i128
impl SaturatingPowAssign<u64> for i128
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < 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 SaturatingPowAssign<u64> for isize
impl SaturatingPowAssign<u64> for isize
sourcefn saturating_pow_assign(&mut self, exp: u64)
fn saturating_pow_assign(&mut self, exp: u64)
Raises a number to a power, in place, saturating at the numeric bounds instead of overflowing.
$$
x \gets \begin{cases}
x^y & \text{if} \quad m \leq x^y \leq M, \\
M & \text{if} \quad x^y > M, \\
m & \text{if} \quad x^y < m,
\end{cases}
$$
where $m$ is Self::MIN
and $M$ is Self::MAX
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.