Trait malachite_base::num::arithmetic::traits::WrappingSquare
source · [−]pub trait WrappingSquare {
type Output;
fn wrapping_square(self) -> Self::Output;
}
Expand description
Squares a number, wrapping around at the boundary of the type.
Required Associated Types
Required Methods
fn wrapping_square(self) -> Self::Output
Implementations on Foreign Types
sourceimpl WrappingSquare for u8
impl WrappingSquare for u8
sourcefn wrapping_square(self) -> u8
fn wrapping_square(self) -> u8
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl WrappingSquare for u16
impl WrappingSquare for u16
sourcefn wrapping_square(self) -> u16
fn wrapping_square(self) -> u16
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl WrappingSquare for u32
impl WrappingSquare for u32
sourcefn wrapping_square(self) -> u32
fn wrapping_square(self) -> u32
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl WrappingSquare for u64
impl WrappingSquare for u64
sourcefn wrapping_square(self) -> u64
fn wrapping_square(self) -> u64
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl WrappingSquare for u128
impl WrappingSquare for u128
sourcefn wrapping_square(self) -> u128
fn wrapping_square(self) -> u128
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl WrappingSquare for usize
impl WrappingSquare for usize
sourcefn wrapping_square(self) -> usize
fn wrapping_square(self) -> usize
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = usize
sourceimpl WrappingSquare for i8
impl WrappingSquare for i8
sourcefn wrapping_square(self) -> i8
fn wrapping_square(self) -> i8
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = i8
sourceimpl WrappingSquare for i16
impl WrappingSquare for i16
sourcefn wrapping_square(self) -> i16
fn wrapping_square(self) -> i16
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = i16
sourceimpl WrappingSquare for i32
impl WrappingSquare for i32
sourcefn wrapping_square(self) -> i32
fn wrapping_square(self) -> i32
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = i32
sourceimpl WrappingSquare for i64
impl WrappingSquare for i64
sourcefn wrapping_square(self) -> i64
fn wrapping_square(self) -> i64
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = i64
sourceimpl WrappingSquare for i128
impl WrappingSquare for i128
sourcefn wrapping_square(self) -> i128
fn wrapping_square(self) -> i128
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = i128
sourceimpl WrappingSquare for isize
impl WrappingSquare for isize
sourcefn wrapping_square(self) -> isize
fn wrapping_square(self) -> isize
Squares a number, wrapping around at the boundary of the type.
$f(x) = y$, where $y \equiv x^2 \mod 2^W$ and $W$ is Self::WIDTH
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.