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
-- Positive rounds up
f1 := CEIL(2.1e0),
-- Another positive
f2 := CEIL(2.9e0),
-- Negative rounds toward zero
f3 := CEIL(-2.1e0),
-- Negative closer to integer
f4 := CEIL(-2.9e0),
-- Exact integer unchanged
f5 := CEIL(5.0e0),
-- Pi rounds up to 4
f6 := CEIL(3.14159e0)
;Result
| f1 BIGINT | f2 BIGINT | f3 BIGINT | f4 BIGINT | f5 BIGINT | f6 BIGINT |
|---|---|---|---|---|---|
| 3 | 3 | -2 | -2 | 5 | 4 |
On this page