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:
- Oracle 12c
- Oracle 11g
- Oracle 10g
- Oracle 9i
- 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.
Please Login to comment...