pub trait ModPowerOf2Add<RHS = Self> {
type Output;

fn mod_power_of_2_add(self, other: RHS, pow: u64) -> Self::Output;
}
Expand description

Adds two numbers modulo $2^k$. Assumes the inputs are already reduced modulo $2^k$.

## Implementations on Foreign Types

Adds two numbers modulo a third number $2^k$. Assumes the inputs are already reduced modulo $2^k$.

$f(x, y, k) = z$, where $x, y, z < 2^k$ and $x + y \equiv z \mod 2^k$.

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Adds two numbers modulo a third number $2^k$. Assumes the inputs are already reduced modulo $2^k$.

$f(x, y, k) = z$, where $x, y, z < 2^k$ and $x + y \equiv z \mod 2^k$.

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Adds two numbers modulo a third number $2^k$. Assumes the inputs are already reduced modulo $2^k$.

$f(x, y, k) = z$, where $x, y, z < 2^k$ and $x + y \equiv z \mod 2^k$.

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Adds two numbers modulo a third number $2^k$. Assumes the inputs are already reduced modulo $2^k$.

$f(x, y, k) = z$, where $x, y, z < 2^k$ and $x + y \equiv z \mod 2^k$.

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Adds two numbers modulo a third number $2^k$. Assumes the inputs are already reduced modulo $2^k$.

$f(x, y, k) = z$, where $x, y, z < 2^k$ and $x + y \equiv z \mod 2^k$.

##### Panics

Panics if pow is greater than Self::WIDTH.

##### Examples

See here.

Adds two numbers modulo a third number $2^k$. Assumes the inputs are already reduced modulo $2^k$.

$f(x, y, k) = z$, where $x, y, z < 2^k$ and $x + y \equiv z \mod 2^k$.

##### Worst-case complexity

Panics if pow is greater than Self::WIDTH.