pub trait ModPowerOf2NegAssign {
    // Required method
    fn mod_power_of_2_neg_assign(&mut self, pow: u64);
}
Expand description

Negates a number modulo $2^k$ in place. The input must be already reduced modulo $2^k$.

Required Methods§

Implementations on Foreign Types§

source§

impl ModPowerOf2NegAssign for u8

source§

fn mod_power_of_2_neg_assign(&mut self, pow: u64)

Negates a number modulo another number $2^k$, in place. The input must be already reduced modulo $2^k$.

$x \gets y$, where $x, y < 2^k$ and $-x \equiv y \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2NegAssign for u16

source§

fn mod_power_of_2_neg_assign(&mut self, pow: u64)

Negates a number modulo another number $2^k$, in place. The input must be already reduced modulo $2^k$.

$x \gets y$, where $x, y < 2^k$ and $-x \equiv y \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2NegAssign for u32

source§

fn mod_power_of_2_neg_assign(&mut self, pow: u64)

Negates a number modulo another number $2^k$, in place. The input must be already reduced modulo $2^k$.

$x \gets y$, where $x, y < 2^k$ and $-x \equiv y \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2NegAssign for u64

source§

fn mod_power_of_2_neg_assign(&mut self, pow: u64)

Negates a number modulo another number $2^k$, in place. The input must be already reduced modulo $2^k$.

$x \gets y$, where $x, y < 2^k$ and $-x \equiv y \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2NegAssign for u128

source§

fn mod_power_of_2_neg_assign(&mut self, pow: u64)

Negates a number modulo another number $2^k$, in place. The input must be already reduced modulo $2^k$.

$x \gets y$, where $x, y < 2^k$ and $-x \equiv y \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

source§

impl ModPowerOf2NegAssign for usize

source§

fn mod_power_of_2_neg_assign(&mut self, pow: u64)

Negates a number modulo another number $2^k$, in place. The input must be already reduced modulo $2^k$.

$x \gets y$, where $x, y < 2^k$ and $-x \equiv y \mod 2^k$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

Implementors§