Trait malachite_base::num::arithmetic::traits::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

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§