Trait dashu_int::ops::SquareRoot

source ·
pub trait SquareRoot {
    type Output;

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

Compute the square root of the number.

The result should be rounded towards zero by default.

Examples

assert_eq!(256u32.sqrt(), 16);
assert_eq!(257u32.sqrt(), 16);

Required Associated Types§

Required Methods§

source

fn sqrt(&self) -> Self::Output

Implementations on Foreign Types§

source§

impl SquareRoot for u8

§

type Output = u8

source§

fn sqrt(&self) -> <u8 as SquareRoot>::Output

source§

impl SquareRoot for u16

§

type Output = u8

source§

fn sqrt(&self) -> u8

source§

impl SquareRoot for u64

§

type Output = u32

source§

fn sqrt(&self) -> u32

source§

impl SquareRoot for u128

§

type Output = u64

source§

fn sqrt(&self) -> u64

source§

impl SquareRoot for u32

§

type Output = u16

source§

fn sqrt(&self) -> u16

Implementors§