Trait malachite_base::num::arithmetic::traits::ModSquareAssign
source · [−]pub trait ModSquareAssign<M = Self> {
fn mod_square_assign(&mut self, m: M);
}
Expand description
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Required Methods
fn mod_square_assign(&mut self, m: M)
Implementations on Foreign Types
sourceimpl ModSquareAssign<u8> for u8
impl ModSquareAssign<u8> for u8
sourcefn mod_square_assign(&mut self, m: u8)
fn mod_square_assign(&mut self, m: u8)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquareAssign<u16> for u16
impl ModSquareAssign<u16> for u16
sourcefn mod_square_assign(&mut self, m: u16)
fn mod_square_assign(&mut self, m: u16)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquareAssign<u32> for u32
impl ModSquareAssign<u32> for u32
sourcefn mod_square_assign(&mut self, m: u32)
fn mod_square_assign(&mut self, m: u32)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquareAssign<u64> for u64
impl ModSquareAssign<u64> for u64
sourcefn mod_square_assign(&mut self, m: u64)
fn mod_square_assign(&mut self, m: u64)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquareAssign<u128> for u128
impl ModSquareAssign<u128> for u128
sourcefn mod_square_assign(&mut self, m: u128)
fn mod_square_assign(&mut self, m: u128)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquareAssign<usize> for usize
impl ModSquareAssign<usize> for usize
sourcefn mod_square_assign(&mut self, m: usize)
fn mod_square_assign(&mut self, m: usize)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
$x \gets y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.