floor
fn floor(float x) -> float
Source: compiler/src/builtin_docs/prelude/math.hy Returns the largest whole number less than or equal to x, as a float.
Use floor(x) as int to get an int.
Parameters#
| Name | Type |
|---|---|
x | float |
Returns#
float
Examples#
use tests::assert;
assert!(floor(2.7) == 2.0);
assert!(floor(-2.1) == -3.0);