CEIL
All functions > MATH > CEIL
Returns the number rounded up to the nearest integer (ceiling function).
Signatures
Returns: Integer result of rounding up
CEIL(number: T) → BIGINT sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | The number to round up |
Notes
- Always rounds towards positive infinity
CEIL(2.1) = 3,CEIL(2.9) = 3CEIL(-2.1) = -2,CEIL(-2.9) = -2- Returns NULL if the input is NULL
- For exact integers, returns the same value
Examples
FeatureQL
SELECT
f1 := CEIL(2.1e0), -- Positive decimal rounds up
f2 := CEIL(2.9e0), -- Another positive decimal
f3 := CEIL(-2.1e0), -- Negative rounds toward zero
f4 := CEIL(-2.9e0), -- Negative closer to integer
f5 := CEIL(5.0e0), -- Exact integer unchanged
f6 := CEIL(0.0e0), -- Zero unchanged
f7 := CEIL(3.14159e0), -- Pi rounds up to 4
f8 := CEIL(-3.14159e0) -- Negative pi rounds to -3
;Result
| f1 BIGINT | f2 BIGINT | f3 BIGINT | f4 BIGINT | f5 BIGINT | f6 BIGINT | f7 BIGINT | f8 BIGINT |
|---|---|---|---|---|---|---|---|
| 3 | 3 | -2 | -2 | 5 | 0 | 4 | -3 |
On this page