Open In App

PLSQL | EXP Function

Improve
Improve
Like Article
Like
Save
Share
Report

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.


Last Updated : 01 Nov, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads