Oracle EXP() Function

Oracle EXP() is a built-in function that returns the natural constant e raised to the power of the given parameter.

e is the base of the natural logarithm, also known as the natural base, approximately equal to 2.71828. Please refer to LN() functions and LOG() functions for more details.

Oracle EXP() syntax

Here is the syntax for the Oracle EXP() function:

EXP(num)

Parameters

num

Required. It can be any numeric data type or any non-numeric data type that can be implicitly converted to a numeric data type.

Return Value

The Oracle EXP() function returns the natural constant e raised to the power of the given parameter.

If the parameter is BINARY_FLOAT, ASIN() returns BINARY_DOUBLE. Otherwise ASIN() returns the same numeric data type as the parameter.

If any parameter is NULL, EXP() will return NULL.

Oracle EXP() Examples

Here are some examples that demonstrate the usage of the Oracle EXP() function.

Basic Usage

SELECT
    EXP(5) "e to the 5th power"
FROM dual;

Output:

                         e to the 5th power
___________________________________________
   148.413159102576603421115580040552279624

Get Natural Base

You can pass 1 as a parameter to the Oracle EXP() function to get the value of the natural base:

SELECT
    EXP(1) E
FROM dual;

Output:

                                          E
___________________________________________
   2.71828182845904523536028747135266249776

NULL Parameters

If any parameter is NULL, EXP() will return NULL.

SET NULL 'NULL';
SELECT
    EXP(NULL)
FROM dual;

Output:

   EXP(NULL)
____________
        NULL

In this example, we use the statement SET NULL 'NULL'; to display NULL values as the string 'NULL'.

Conclusion

Oracle EXP() is a built-in function that returns the natural constant e raised to the power of the given parameter.