Skip to main content

SquareRootRem

Trait SquareRootRem 

Source
pub trait SquareRootRem {
    type Output;

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

Computer the floored square root of the number and return the remainder at the same time.

Required Associated Types§

Source

type Output

The type of the (floored) root and the remainder.

Required Methods§

Source

fn sqrt_rem(&self) -> (Self::Output, Self)

Compute the floored square root together with the remainder, so that root*root + rem == *self and 0 <= rem <= 2*root.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SquareRootRem for u8

Source§

type Output = u8

Source§

fn sqrt_rem(&self) -> (u8, u8)

Source§

impl SquareRootRem for u16

Source§

type Output = u8

Source§

fn sqrt_rem(&self) -> (u8, u16)

Source§

impl SquareRootRem for u32

Source§

type Output = u16

Source§

fn sqrt_rem(&self) -> (u16, u32)

Source§

impl SquareRootRem for u64

Source§

type Output = u32

Source§

fn sqrt_rem(&self) -> (u32, u64)

Source§

impl SquareRootRem for u128

Implementors§