PLSQL | EXP Function

The EXP is an inbuilt function in PLSQL which is used to return a value which is e raised to the nth power. Here “e” is a mathematical constant whose value is 2.7182818 and n is the input number.

Syntax:

exp(number)

Parameters Used:
Here the parameter number is the input number which is raised to the power of “e”.



Return Value:
This function returns a value which is e raised to the nth power. where n is the 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 EXP function:

Example-1:

DECLARE 
   Test_Number number := 3;
   
BEGIN 
   dbms_output.put_line(EXP(Test_Number number)); 
   
END;  

Output:

20.0855369231877

In the above example, 3 is taken as the parameter which is raised to e. And then it gives a result of 20.0855369231877

Example-2:

DECLARE 
   Test_Number number := 3.1;
   
BEGIN 
   dbms_output.put_line(EXP(Test_Number number)); 
   
END;  

Output:

22.1979512814416

In the above example, 3.1 is taken as the parameter which is raised to e. And then it gives a result of 22.1979512814416

Example-3:

DECLARE 
   Test_Number number := -3;
   
BEGIN 
   dbms_output.put_line(EXP(Test_Number number)); 
   
END; 

Output:

0.0497870683678639

In the above example, -3 is taken as the parameter which is raised to e. And then it gives a result of 0.0497870683678639

Advantage:
This function is used to find out a value which is e raised to the nth power. Here “e” is a mathematical constant whose value is 2.7182818 and n is the 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.