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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl SquareRoot for u8
impl SquareRoot for u8
Source§impl SquareRoot for u16
Available on crate feature std only.
impl SquareRoot for u16
Available on crate feature
std only.Source§impl SquareRoot for u32
Available on crate feature std only.
impl SquareRoot for u32
Available on crate feature
std only.Source§impl SquareRoot for u64
Available on crate feature std only.
impl SquareRoot for u64
Available on crate feature
std only.Source§impl SquareRoot for u128
Available on crate feature std only.
impl SquareRoot for u128
Available on crate feature
std only.