Skip to main content

WrappingSquare

Trait WrappingSquare 

Source
pub trait WrappingSquare {
    type Output;

    // Required method
    fn wrapping_square(self) -> Self::Output;
}
Expand description

Squares a number, wrapping around at the boundary of the type.

Required Associated Types§

Required Methods§

Source

fn wrapping_square(self) -> Self::Output

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl WrappingSquare for i8

Source§

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.

Source§

type Output = i8

Source§

impl WrappingSquare for i16

Source§

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.

Source§

type Output = i16

Source§

impl WrappingSquare for i32

Source§

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.

Source§

type Output = i32

Source§

impl WrappingSquare for i64

Source§

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.

Source§

type Output = i64

Source§

impl WrappingSquare for i128

Source§

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.

Source§

type Output = i128

Source§

impl WrappingSquare for isize

Source§

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.

Source§

type Output = isize

Source§

impl WrappingSquare for u8

Source§

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.

Source§

type Output = u8

Source§

impl WrappingSquare for u16

Source§

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.

Source§

type Output = u16

Source§

impl WrappingSquare for u32

Source§

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.

Source§

type Output = u32

Source§

impl WrappingSquare for u64

Source§

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.

Source§

type Output = u64

Source§

impl WrappingSquare for u128

Source§

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.

Source§

type Output = u128

Source§

impl WrappingSquare for usize

Source§

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.

Source§

type Output = usize

Implementors§