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

Negates a number modulo $2^k$ in place. Assumes the input is already reduced modulo $2^k$.

Required Methods

Implementations on Foreign Types

Negates a number modulo another number $2^k$, in place. Assumes the input is 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.

Examples

See here.

Negates a number modulo another number $2^k$, in place. Assumes the input is 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.

Examples

See here.

Negates a number modulo another number $2^k$, in place. Assumes the input is 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.

Examples

See here.

Negates a number modulo another number $2^k$, in place. Assumes the input is 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.

Examples

See here.

Negates a number modulo another number $2^k$, in place. Assumes the input is 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.

Examples

See here.

Negates a number modulo another number $2^k$, in place. Assumes the input is 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.

Examples

See here.

Implementors