FLOOR()
All functions > MATH > FLOOR()
Returns the largest integer less than or equal to the input.
Signatures
Floor
Returns: Largest integer ≤ input
FLOOR(number: T) → BIGINT sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | The number to round down |
With:
T: Custom types: FLOAT | DOUBLE | DECIMAL
Signature notes:
- Always rounds toward negative infinity
- Returns NULL if the input is NULL
- Opposite of CEIL for negative numbers
Examples
FeatureQL
SELECT
f1 := FLOOR(2.1E0), -- Positive rounds down
f2 := FLOOR(2.9E0), -- Another positive
f3 := FLOOR(-2.1E0), -- Negative rounds away from zero
f4 := FLOOR(-2.9E0), -- Negative further from zero
f5 := FLOOR(5.0E0), -- Exact integer unchanged
f6 := FLOOR(3.14159E0) -- Pi rounds down to 3
;Result
| f1 BIGINT | f2 BIGINT | f3 BIGINT | f4 BIGINT | f5 BIGINT | f6 BIGINT |
|---|---|---|---|---|---|
| 2 | 2 | -3 | -3 | 5 | 3 |
On this page