Oracle Ceil Floor Function

Pictorial presentation of floor function.
Oracle ceil floor function. The floor function determines the largest integer less than or equal to a particular numeric value. Select 1561 75 as number ceil 1561 75 from dual. I am continuing my efforts to cover the basics yet important topics of oracle database with this post i am trying to provide bit of explanation and some examples of round trunc ceil and floor functions in oracle database. The function returns the same data type as the numeric data type of the argument.
If the specified number is null the result of these functions is null. Here is the result. Ceil or ceiling function. Ceil returns smallest integer greater than or equal to n.
It s the opposite of the ceil function. Oracle ceil function the ceil function returns returns smallest integer greater than or equal to passed number n. Pictorial presentation of ceil function. Floor and ceil unlike round and trunc do not take an.
The oracle plsql ceil function returns the smallest integer value that is greater than or equal to a number. The purpose of the oracle ceil function is to return the smallest integer value greater than or equal to the supplied number. The statement below returns 4 which is the largest integer value of given number 4 93 as specified in the argument. Similar to round and trunc are the floor and ceil number functions.
The ceil and ceiling functions round the specified number up and return the smallest number that is greater than or equal to the specified number. Select floor 4 93 from dual. Default value of i is 0. The function returns the same data type as the numeric data type of the argument.
The statement below returns 1562 which is the smallest integer value not less than the value specified 1561 75 in the argument. Conversely the ceil function determines the smallest integer greater than or equal to a particular numeric value. Learn what they are and see some examples in this article. In other words it rounds down to the nearest whole number.
Round returns n rounded to i places to the right of the decimal point. The oracle floor function will return the largest integer value less than the specified number. This function takes as an argument any numeric datatype or any nonnumeric datatype that can be implicitly converted to a numeric datatype. The specified number must be a double precision number.
Here is the result. The oracle ceil function and floor function are opposites of each other and are very useful functions when dealing with numbers.