CEIL()
All functions > MATH > CEIL()
Returns the smallest integer greater than or equal to the input.
Signatures
Ceiling
Returns: Smallest integer ≥ input
CEIL(number: T) → BIGINT sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | The number to round up |
With:
T: Custom types: FLOAT | DOUBLE | DECIMAL
Signature notes:
- Always rounds toward positive infinity
- Returns NULL if the input is NULL
- For exact integer values, returns the same value
Examples
FeatureQL
SELECT
f1 := CEIL(2.1E0), -- Positive rounds up
f2 := CEIL(2.9E0), -- Another positive
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(3.14159E0) -- Pi rounds up to 4
;Result
| f1 BIGINT | f2 BIGINT | f3 BIGINT | f4 BIGINT | f5 BIGINT | f6 BIGINT |
|---|---|---|---|---|---|
| 3 | 3 | -2 | -2 | 5 | 4 |
On this page