CEIL
The CEILING function returns the smallest integer greater than or equal to the specified value. In other words, it rounds the given value up to the nearest integer. This is useful when you need to ensure a value is not below a certain threshold.
Syntax
Parameters
value: The numeric value to round up. Can be an integer, floating-point number, or other numeric type.
Return Value
- Returns the smallest integer greater than or equal to
value. The result type is typically an integer.
Examples
- Basic example:
- Negative number example:
Notes
- The return value of
CEILINGis always an integer type. - For positive numbers,
CEILINGrounds up to the next integer; for negative numbers, it returns the less negative integer (i.e., the one closer to zero). - If the input value is already an integer,
CEILINGreturns that integer unchanged.
