Oracle CEIL() function
Description
The CEIL() function returns the smallest integer that is not less than the number specified as an argument.
The function takes any numeric or nonnumeric data type (can be implicitly converted to a numeric data type) as an argument.
Uses of Oracle CEIL() Function
- Rounding Up: Obtain the smallest integer greater than or equal to a given number.
- Data Manipulation: Adjust numerical data to the next whole number for calculations.
- Financial Calculations: Ensure values such as prices or costs are rounded up to the nearest integer.
- Mathematical Operations: Perform ceiling operations in various mathematical and statistical computations.
- Data Analysis: Simplify data by converting floating-point numbers to integers.
- Programming Logic: Implement ceiling operations in algorithms requiring whole numbers.
Syntax:
CEIL(N);
Parameters:
Name | Description |
---|---|
N | A number. |
The function returns the same data type as the numeric data type of the argument.
Pictorial Presentation of CEIL() function
Example:
The statement below returns 1562 which is the smallest integer value not less than the value specified (1561.75) in the argument.
SELECT 1561.75 AS "Number", CEIL(1561.75)
FROM dual;
Here is the result
Number CEIL(1561.75) ---------- ------------- 1561.75 1562
Example: CEIL() function with negative value
The statement below returns -1561 which is the smallest integer value not less than the value specified (-1561.75) in the argument.
SELECT -1561.75 AS "Number", CEIL(-1561.75)
FROM dual;
Here is the result
Number CEIL(-1561.75) ---------- -------------- -1561.75 -1561
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/oracle/oracle-numeric-functions/oracle-ceil-function.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics