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§
source§impl WrappingSquare for u8
impl WrappingSquare for u8
source§fn 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
source§impl WrappingSquare for u16
impl WrappingSquare for u16
source§fn 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
source§impl WrappingSquare for u32
impl WrappingSquare for u32
source§fn 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
source§impl WrappingSquare for u64
impl WrappingSquare for u64
source§fn 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
source§impl WrappingSquare for u128
impl WrappingSquare for u128
source§fn 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
source§impl WrappingSquare for usize
impl WrappingSquare for usize
source§fn 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
source§impl WrappingSquare for i8
impl WrappingSquare for i8
source§fn 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
source§impl WrappingSquare for i16
impl WrappingSquare for i16
source§fn 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
source§impl WrappingSquare for i32
impl WrappingSquare for i32
source§fn 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
source§impl WrappingSquare for i64
impl WrappingSquare for i64
source§fn 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
source§impl WrappingSquare for i128
impl WrappingSquare for i128
source§fn 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
source§impl WrappingSquare for isize
impl WrappingSquare for isize
source§fn 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.