Function floor

Source
pub fn floor(x: f64) -> f64
Expand description

§floor(x)

Rounding Function

The floor function returns the largest integer less than or equal to a given floating-point number.

§Examples

use mathlab::math::floor;
assert_eq!(floor(0.0), 0.0);
assert_eq!(floor(0.99), 0.0);
assert_eq!(floor(-0.99), -1.0);
assert_eq!(floor(1.99), 1.0);
assert_eq!(floor(1.01), 1.0);
assert_eq!(floor(-1.99), -2.0);

End Fun Doc