Trait malachite_base::num::arithmetic::traits::ModPowerOf2Shl
source · [−]pub trait ModPowerOf2Shl<RHS> {
type Output;
fn mod_power_of_2_shl(self, other: RHS, pow: u64) -> Self::Output;
}
Expand description
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
Required Associated Types
Required Methods
fn mod_power_of_2_shl(self, other: RHS, pow: u64) -> Self::Output
Implementations on Foreign Types
sourceimpl ModPowerOf2Shl<u8> for u8
impl ModPowerOf2Shl<u8> for u8
sourcefn mod_power_of_2_shl(self, other: u8, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: u8, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u8
sourceimpl ModPowerOf2Shl<u16> for u8
impl ModPowerOf2Shl<u16> for u8
sourcefn mod_power_of_2_shl(self, other: u16, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: u16, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u8
sourceimpl ModPowerOf2Shl<u32> for u8
impl ModPowerOf2Shl<u32> for u8
sourcefn mod_power_of_2_shl(self, other: u32, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: u32, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u8
sourceimpl ModPowerOf2Shl<u64> for u8
impl ModPowerOf2Shl<u64> for u8
sourcefn mod_power_of_2_shl(self, other: u64, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: u64, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u8
sourceimpl ModPowerOf2Shl<u128> for u8
impl ModPowerOf2Shl<u128> for u8
sourcefn mod_power_of_2_shl(self, other: u128, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: u128, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u8
sourceimpl ModPowerOf2Shl<usize> for u8
impl ModPowerOf2Shl<usize> for u8
sourcefn mod_power_of_2_shl(self, other: usize, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: usize, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u8
sourceimpl ModPowerOf2Shl<u8> for u16
impl ModPowerOf2Shl<u8> for u16
sourcefn mod_power_of_2_shl(self, other: u8, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: u8, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u16
sourceimpl ModPowerOf2Shl<u16> for u16
impl ModPowerOf2Shl<u16> for u16
sourcefn mod_power_of_2_shl(self, other: u16, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: u16, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u16
sourceimpl ModPowerOf2Shl<u32> for u16
impl ModPowerOf2Shl<u32> for u16
sourcefn mod_power_of_2_shl(self, other: u32, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: u32, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u16
sourceimpl ModPowerOf2Shl<u64> for u16
impl ModPowerOf2Shl<u64> for u16
sourcefn mod_power_of_2_shl(self, other: u64, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: u64, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u16
sourceimpl ModPowerOf2Shl<u128> for u16
impl ModPowerOf2Shl<u128> for u16
sourcefn mod_power_of_2_shl(self, other: u128, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: u128, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u16
sourceimpl ModPowerOf2Shl<usize> for u16
impl ModPowerOf2Shl<usize> for u16
sourcefn mod_power_of_2_shl(self, other: usize, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: usize, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u16
sourceimpl ModPowerOf2Shl<u8> for u32
impl ModPowerOf2Shl<u8> for u32
sourcefn mod_power_of_2_shl(self, other: u8, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: u8, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u32
sourceimpl ModPowerOf2Shl<u16> for u32
impl ModPowerOf2Shl<u16> for u32
sourcefn mod_power_of_2_shl(self, other: u16, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: u16, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u32
sourceimpl ModPowerOf2Shl<u32> for u32
impl ModPowerOf2Shl<u32> for u32
sourcefn mod_power_of_2_shl(self, other: u32, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: u32, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u32
sourceimpl ModPowerOf2Shl<u64> for u32
impl ModPowerOf2Shl<u64> for u32
sourcefn mod_power_of_2_shl(self, other: u64, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: u64, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u32
sourceimpl ModPowerOf2Shl<u128> for u32
impl ModPowerOf2Shl<u128> for u32
sourcefn mod_power_of_2_shl(self, other: u128, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: u128, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u32
sourceimpl ModPowerOf2Shl<usize> for u32
impl ModPowerOf2Shl<usize> for u32
sourcefn mod_power_of_2_shl(self, other: usize, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: usize, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u32
sourceimpl ModPowerOf2Shl<u8> for u64
impl ModPowerOf2Shl<u8> for u64
sourcefn mod_power_of_2_shl(self, other: u8, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: u8, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u64
sourceimpl ModPowerOf2Shl<u16> for u64
impl ModPowerOf2Shl<u16> for u64
sourcefn mod_power_of_2_shl(self, other: u16, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: u16, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u64
sourceimpl ModPowerOf2Shl<u32> for u64
impl ModPowerOf2Shl<u32> for u64
sourcefn mod_power_of_2_shl(self, other: u32, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: u32, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u64
sourceimpl ModPowerOf2Shl<u64> for u64
impl ModPowerOf2Shl<u64> for u64
sourcefn mod_power_of_2_shl(self, other: u64, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: u64, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u64
sourceimpl ModPowerOf2Shl<u128> for u64
impl ModPowerOf2Shl<u128> for u64
sourcefn mod_power_of_2_shl(self, other: u128, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: u128, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u64
sourceimpl ModPowerOf2Shl<usize> for u64
impl ModPowerOf2Shl<usize> for u64
sourcefn mod_power_of_2_shl(self, other: usize, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: usize, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u64
sourceimpl ModPowerOf2Shl<u8> for u128
impl ModPowerOf2Shl<u8> for u128
sourcefn mod_power_of_2_shl(self, other: u8, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: u8, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u128
sourceimpl ModPowerOf2Shl<u16> for u128
impl ModPowerOf2Shl<u16> for u128
sourcefn mod_power_of_2_shl(self, other: u16, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: u16, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u128
sourceimpl ModPowerOf2Shl<u32> for u128
impl ModPowerOf2Shl<u32> for u128
sourcefn mod_power_of_2_shl(self, other: u32, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: u32, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u128
sourceimpl ModPowerOf2Shl<u64> for u128
impl ModPowerOf2Shl<u64> for u128
sourcefn mod_power_of_2_shl(self, other: u64, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: u64, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u128
sourceimpl ModPowerOf2Shl<u128> for u128
impl ModPowerOf2Shl<u128> for u128
sourcefn mod_power_of_2_shl(self, other: u128, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: u128, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u128
sourceimpl ModPowerOf2Shl<usize> for u128
impl ModPowerOf2Shl<usize> for u128
sourcefn mod_power_of_2_shl(self, other: usize, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: usize, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = u128
sourceimpl ModPowerOf2Shl<u8> for usize
impl ModPowerOf2Shl<u8> for usize
sourcefn mod_power_of_2_shl(self, other: u8, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: u8, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = usize
sourceimpl ModPowerOf2Shl<u16> for usize
impl ModPowerOf2Shl<u16> for usize
sourcefn mod_power_of_2_shl(self, other: u16, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: u16, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = usize
sourceimpl ModPowerOf2Shl<u32> for usize
impl ModPowerOf2Shl<u32> for usize
sourcefn mod_power_of_2_shl(self, other: u32, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: u32, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = usize
sourceimpl ModPowerOf2Shl<u64> for usize
impl ModPowerOf2Shl<u64> for usize
sourcefn mod_power_of_2_shl(self, other: u64, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: u64, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = usize
sourceimpl ModPowerOf2Shl<u128> for usize
impl ModPowerOf2Shl<u128> for usize
sourcefn mod_power_of_2_shl(self, other: u128, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: u128, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = usize
sourceimpl ModPowerOf2Shl<usize> for usize
impl ModPowerOf2Shl<usize> for usize
sourcefn mod_power_of_2_shl(self, other: usize, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: usize, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $2^nx \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.
type Output = usize
sourceimpl ModPowerOf2Shl<i8> for u8
impl ModPowerOf2Shl<i8> for u8
sourcefn mod_power_of_2_shl(self, other: i8, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: i8, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl ModPowerOf2Shl<i16> for u8
impl ModPowerOf2Shl<i16> for u8
sourcefn mod_power_of_2_shl(self, other: i16, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: i16, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl ModPowerOf2Shl<i32> for u8
impl ModPowerOf2Shl<i32> for u8
sourcefn mod_power_of_2_shl(self, other: i32, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: i32, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl ModPowerOf2Shl<i64> for u8
impl ModPowerOf2Shl<i64> for u8
sourcefn mod_power_of_2_shl(self, other: i64, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: i64, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl ModPowerOf2Shl<i128> for u8
impl ModPowerOf2Shl<i128> for u8
sourcefn mod_power_of_2_shl(self, other: i128, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: i128, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl ModPowerOf2Shl<isize> for u8
impl ModPowerOf2Shl<isize> for u8
sourcefn mod_power_of_2_shl(self, other: isize, pow: u64) -> u8
fn mod_power_of_2_shl(self, other: isize, pow: u64) -> u8
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl ModPowerOf2Shl<i8> for u16
impl ModPowerOf2Shl<i8> for u16
sourcefn mod_power_of_2_shl(self, other: i8, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: i8, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl ModPowerOf2Shl<i16> for u16
impl ModPowerOf2Shl<i16> for u16
sourcefn mod_power_of_2_shl(self, other: i16, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: i16, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl ModPowerOf2Shl<i32> for u16
impl ModPowerOf2Shl<i32> for u16
sourcefn mod_power_of_2_shl(self, other: i32, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: i32, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl ModPowerOf2Shl<i64> for u16
impl ModPowerOf2Shl<i64> for u16
sourcefn mod_power_of_2_shl(self, other: i64, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: i64, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl ModPowerOf2Shl<i128> for u16
impl ModPowerOf2Shl<i128> for u16
sourcefn mod_power_of_2_shl(self, other: i128, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: i128, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl ModPowerOf2Shl<isize> for u16
impl ModPowerOf2Shl<isize> for u16
sourcefn mod_power_of_2_shl(self, other: isize, pow: u64) -> u16
fn mod_power_of_2_shl(self, other: isize, pow: u64) -> u16
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl ModPowerOf2Shl<i8> for u32
impl ModPowerOf2Shl<i8> for u32
sourcefn mod_power_of_2_shl(self, other: i8, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: i8, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl ModPowerOf2Shl<i16> for u32
impl ModPowerOf2Shl<i16> for u32
sourcefn mod_power_of_2_shl(self, other: i16, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: i16, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl ModPowerOf2Shl<i32> for u32
impl ModPowerOf2Shl<i32> for u32
sourcefn mod_power_of_2_shl(self, other: i32, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: i32, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl ModPowerOf2Shl<i64> for u32
impl ModPowerOf2Shl<i64> for u32
sourcefn mod_power_of_2_shl(self, other: i64, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: i64, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl ModPowerOf2Shl<i128> for u32
impl ModPowerOf2Shl<i128> for u32
sourcefn mod_power_of_2_shl(self, other: i128, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: i128, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl ModPowerOf2Shl<isize> for u32
impl ModPowerOf2Shl<isize> for u32
sourcefn mod_power_of_2_shl(self, other: isize, pow: u64) -> u32
fn mod_power_of_2_shl(self, other: isize, pow: u64) -> u32
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl ModPowerOf2Shl<i8> for u64
impl ModPowerOf2Shl<i8> for u64
sourcefn mod_power_of_2_shl(self, other: i8, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: i8, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl ModPowerOf2Shl<i16> for u64
impl ModPowerOf2Shl<i16> for u64
sourcefn mod_power_of_2_shl(self, other: i16, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: i16, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl ModPowerOf2Shl<i32> for u64
impl ModPowerOf2Shl<i32> for u64
sourcefn mod_power_of_2_shl(self, other: i32, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: i32, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl ModPowerOf2Shl<i64> for u64
impl ModPowerOf2Shl<i64> for u64
sourcefn mod_power_of_2_shl(self, other: i64, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: i64, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl ModPowerOf2Shl<i128> for u64
impl ModPowerOf2Shl<i128> for u64
sourcefn mod_power_of_2_shl(self, other: i128, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: i128, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl ModPowerOf2Shl<isize> for u64
impl ModPowerOf2Shl<isize> for u64
sourcefn mod_power_of_2_shl(self, other: isize, pow: u64) -> u64
fn mod_power_of_2_shl(self, other: isize, pow: u64) -> u64
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl ModPowerOf2Shl<i8> for u128
impl ModPowerOf2Shl<i8> for u128
sourcefn mod_power_of_2_shl(self, other: i8, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: i8, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl ModPowerOf2Shl<i16> for u128
impl ModPowerOf2Shl<i16> for u128
sourcefn mod_power_of_2_shl(self, other: i16, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: i16, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl ModPowerOf2Shl<i32> for u128
impl ModPowerOf2Shl<i32> for u128
sourcefn mod_power_of_2_shl(self, other: i32, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: i32, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl ModPowerOf2Shl<i64> for u128
impl ModPowerOf2Shl<i64> for u128
sourcefn mod_power_of_2_shl(self, other: i64, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: i64, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl ModPowerOf2Shl<i128> for u128
impl ModPowerOf2Shl<i128> for u128
sourcefn mod_power_of_2_shl(self, other: i128, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: i128, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl ModPowerOf2Shl<isize> for u128
impl ModPowerOf2Shl<isize> for u128
sourcefn mod_power_of_2_shl(self, other: isize, pow: u64) -> u128
fn mod_power_of_2_shl(self, other: isize, pow: u64) -> u128
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl ModPowerOf2Shl<i8> for usize
impl ModPowerOf2Shl<i8> for usize
sourcefn mod_power_of_2_shl(self, other: i8, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: i8, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = usize
sourceimpl ModPowerOf2Shl<i16> for usize
impl ModPowerOf2Shl<i16> for usize
sourcefn mod_power_of_2_shl(self, other: i16, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: i16, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = usize
sourceimpl ModPowerOf2Shl<i32> for usize
impl ModPowerOf2Shl<i32> for usize
sourcefn mod_power_of_2_shl(self, other: i32, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: i32, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = usize
sourceimpl ModPowerOf2Shl<i64> for usize
impl ModPowerOf2Shl<i64> for usize
sourcefn mod_power_of_2_shl(self, other: i64, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: i64, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = usize
sourceimpl ModPowerOf2Shl<i128> for usize
impl ModPowerOf2Shl<i128> for usize
sourcefn mod_power_of_2_shl(self, other: i128, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: i128, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = usize
sourceimpl ModPowerOf2Shl<isize> for usize
impl ModPowerOf2Shl<isize> for usize
sourcefn mod_power_of_2_shl(self, other: isize, pow: u64) -> usize
fn mod_power_of_2_shl(self, other: isize, pow: u64) -> usize
Left-shifts a number (multiplies it by a power of 2) modulo $2^k$. Assumes the input is already reduced modulo $2^k$.
$f(x, n, k) = y$, where $x, y < 2^k$ and $\lfloor 2^nx \rfloor \equiv y \mod 2^k$.
Panics
Panics if pow
is greater than Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.