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
ParameterTypeRequiredDescription
numberTYesThe 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 BIGINTf2 BIGINTf3 BIGINTf4 BIGINTf5 BIGINTf6 BIGINT
33-2-254

Last update at: 2026/05/26 17:22:09