Trait 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

Source§

impl SquareRoot for u16

Source§

type Output = u8

Source§

fn sqrt(&self) -> u8

Source§

impl SquareRoot for u32

Source§

type Output = u16

Source§

fn sqrt(&self) -> u16

Source§

impl SquareRoot for u64

Source§

type Output = u32

Source§

fn sqrt(&self) -> u32

Source§

impl SquareRoot for u128

Source§

type Output = u64

Source§

fn sqrt(&self) -> u64

Source§

impl SquareRoot for IBig

Source§

impl SquareRoot for UBig

Implementors§

Source§

impl<R: Round, const B: Word> SquareRoot for FBig<R, B>

Source§

type Output = FBig<R, B>