pub fn trunc(x: f64) -> f64
Expand description
§trunc(x)
Rounding Function
The trunc
function returns the integer part of self.
This means that non-integer numbers are always truncated towards zero.
§Examples
use mathlab::math::trunc;
assert_eq!(trunc(-0.37), 0.0);
assert_eq!(trunc(0.37), 0.0);
assert_eq!(trunc(-3.7), -3.0);
assert_eq!(trunc(3.7), 3.0);
End Fun Doc