PLSQL | FLOOR Function

The FLOOR is an inbuilt function in PLSQL which is used to return the largest integer value which will be either equal to or less than from a given input number.

Syntax:

FLOOR(number)

Parameters Used:
This function accepts a parameter number which is the input number on which FLOOR function is called.



Return Value:
This function returns the largest integer value which will be either equal to or less than from a given input number.

Supported Versions of Oracle/PLSQL:

  1. Oracle 12c
  2. Oracle 11g
  3. Oracle 10g
  4. Oracle 9i
  5. Oracle 8i

Let’s see some examples which illustrate the FLOOR function:

Example-1:

DECLARE 
   Test_Number number1 := 2.6;
   
BEGIN 
   dbms_output.put_line(ASIN(Test_Number number1)); 
   
END; 

Output:

2

In the above example, some parameter is taken. Like 2.6 is taken as the parameter and 2 is returned because 2 is the greatest whole number less than 2.6

Example-2:

DECLARE 
   Test_Number number1 := -2.6;
   
BEGIN 
   dbms_output.put_line(ASIN(Test_Number number1)); 
   
END; 

Output:

-3

In the above example, some parameter is taken. In the above example, -2.6 is taken as the parameter and -3 is returned because -3 is the greatest whole number less than -2.6

Advantage:
This function is used to find out the largest integer value which will be either equal to or less than from a given input number.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.