pub trait SaturatingPowAssign<RHS = Self> {
    // Required method
    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§

source

fn saturating_pow_assign(&mut self, exp: RHS)

Implementations on Foreign Types§

source§

impl SaturatingPowAssign for u64

source§

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.

source§

impl SaturatingPowAssign<u64> for i8

source§

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.

source§

impl SaturatingPowAssign<u64> for i16

source§

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.

source§

impl SaturatingPowAssign<u64> for i32

source§

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.

source§

impl SaturatingPowAssign<u64> for i64

source§

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.

source§

impl SaturatingPowAssign<u64> for i128

source§

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.

source§

impl SaturatingPowAssign<u64> for isize

source§

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.

source§

impl SaturatingPowAssign<u64> for u8

source§

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.

source§

impl SaturatingPowAssign<u64> for u16

source§

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.

source§

impl SaturatingPowAssign<u64> for u32

source§

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.

source§

impl SaturatingPowAssign<u64> for u128

source§

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.

source§

impl SaturatingPowAssign<u64> for usize

source§

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.

Implementors§