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);