Trait malachite_base::num::arithmetic::traits::ModPowerOf2SquareAssign
source · [−]pub trait ModPowerOf2SquareAssign {
fn mod_power_of_2_square_assign(&mut self, pow: u64);
}
Expand description
Squares a number modulo $2^k$ in place. Assumes the input is already reduced modulo $2^k$.
Required Methods
fn mod_power_of_2_square_assign(&mut self, pow: u64)
Implementations on Foreign Types
sourceimpl ModPowerOf2SquareAssign for u8
impl ModPowerOf2SquareAssign for u8
sourcefn mod_power_of_2_square_assign(&mut self, pow: u64)
fn mod_power_of_2_square_assign(&mut self, pow: u64)
Squares 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^2 \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.
sourceimpl ModPowerOf2SquareAssign for u16
impl ModPowerOf2SquareAssign for u16
sourcefn mod_power_of_2_square_assign(&mut self, pow: u64)
fn mod_power_of_2_square_assign(&mut self, pow: u64)
Squares 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^2 \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.
sourceimpl ModPowerOf2SquareAssign for u32
impl ModPowerOf2SquareAssign for u32
sourcefn mod_power_of_2_square_assign(&mut self, pow: u64)
fn mod_power_of_2_square_assign(&mut self, pow: u64)
Squares 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^2 \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.
sourceimpl ModPowerOf2SquareAssign for u64
impl ModPowerOf2SquareAssign for u64
sourcefn mod_power_of_2_square_assign(&mut self, pow: u64)
fn mod_power_of_2_square_assign(&mut self, pow: u64)
Squares 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^2 \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.
sourceimpl ModPowerOf2SquareAssign for u128
impl ModPowerOf2SquareAssign for u128
sourcefn mod_power_of_2_square_assign(&mut self, pow: u64)
fn mod_power_of_2_square_assign(&mut self, pow: u64)
Squares 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^2 \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.
sourceimpl ModPowerOf2SquareAssign for usize
impl ModPowerOf2SquareAssign for usize
sourcefn mod_power_of_2_square_assign(&mut self, pow: u64)
fn mod_power_of_2_square_assign(&mut self, pow: u64)
Squares 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^2 \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.