pub fn sqr(x: f64) -> f64
Expand description
§sqr(x)
Native Function
The sqr
function calculates its square by multiplying it with itself.
§Examples
use mathlab::math::{sqr, INF_F64};
assert_eq!(sqr(0.0), 0.0);
assert_eq!(sqr(0.1), 0.010000000000000002);
assert_eq!(sqr(0.1) as f32, 0.01);
assert_eq!(sqr(1.0), 1.0);
assert_eq!(sqr(2.0), 4.0);
assert_eq!(sqr(10.0), 100.0);
assert_eq!(sqr(INF_F64), INF_F64);
End Fun Doc