SQL EXP function is a SQL Mathematical function that is used to return E raised to the power of the given float value, Where E is Euler’s number and it is approximately equal to 2.71828.
SQL EXP()
SQL EXP() is a built-in function that is used for finding the exponent of a float_expression specified. The exponent of the number is the constant e raised to the power of the number. The base of natural logarithms is e (2.718281…), which is constant.
Syntax
SELECT EXP (float_expression);
Parameters
Float_expression: An expression of float or any other type which is implicitly converted to float whose exponential value is to be retrieved.
See the following example.
SELECT EXP(1);
Output
2.71828182845905
Explanation
Here, the exponential value is returned.
See the second example.
SELECT EXP(2.5);
Output
12.182493960703473
Explanation
Here, the exponential value of a fractional number is returned.
Example 3
SELECT EXP (1+2);
Output
20.085536923187668
Explanation
Here, the exponential value of the expression is returned.
Example 4
SELECT EXP (LOG (15)) 'EXP', LOG (EXP (15)) 'LOG';
Output
EXP | LOG |
15 | 15 |
Explanation
Here, we know that the LOG () function is an inverse of the EXP() function. So, the same value is returned.
Conclusion
SQL EXP() function returns the e raised to the n-th power(n is the numeric expression), where e is a base of the natural algorithm and the value of e is approximately 2.71828183.