Trait integer_sqrt::IntegerSquareRoot
[−]
[src]
pub trait IntegerSquareRoot {
fn integer_sqrt_checked(&self) -> Option<Self>
where
Self: Sized;
fn integer_sqrt(&self) -> Self
where
Self: Sized,
{ ... }
}A trait implementing integer square root.
Required Methods
fn integer_sqrt_checked(&self) -> Option<Self> where
Self: Sized,
Self: Sized,
Find the integer square root, returning None if the number is negative (this can never
happen for unsigned types).
Provided Methods
fn integer_sqrt(&self) -> Self where
Self: Sized,
Self: Sized,
Find the integer square root.
See Integer_square_root on wikipedia for more information (and also the source of this algorithm)
Panics
For negative numbers (i family) this function will panic on negative input
Implementations on Foreign Types
impl IntegerSquareRoot for usize[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for u64[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for u32[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for u16[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for u8[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for isize[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for i64[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for i32[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for i16[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,
impl IntegerSquareRoot for i8[src]
fn integer_sqrt_checked(&self) -> Option<Self>[src]
fn integer_sqrt(&self) -> Self where
Self: Sized, [src]
Self: Sized,