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

Implementations on Foreign Types

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Implementors