Floor v0.1.0
Rounds down to the nearest integer value.
Package: Math
Signature
func Floor(x: float64) -> float64;
func Floor(x: float32) -> float32;
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | The value to round. |
Returns
The largest integer value at or below x, still represented as a
floating-point number. Floor(-0.0) is -0.0 and Floor(-Inf) is -Inf;
a NaN passes through unchanged.
Example
import Math::Floor;
func Main() -> int {
let a = Floor(3.7); // 3.0
let b = Floor(-3.2); // -4.0
return 0;
}