EXP
EXP is a mathematical function in SQL that returns Euler's number (approximately 2.718282) raised to the power of a specified number.
EXP(X)
- x: This parameter represents a numeric expression for which the exponential value will be found. EXP(X) returns the value of the function e raised to the power of X, where e is the base of natural logarithms and X is the input argument.
Example
Output
Explanation
The EXP function in SQL returns the natural exponential value of the given number. In the above case, it returns the natural exponential value of 1 which is approximately 2.718281828459045.
EXP( float_expression )
- float_expression: A floating point number which becomes the exponent value for the function. The exponential value of this number is calculated by SQL Server. It is an expression of datatype float, or can be an expression which can be implicitly converted to float.
Example
Output
Explanation
In this SQL Server code snippet, the EXP() function is employed to calculate the exponential value of 1. The resulted value equals approximately 2.71828182845905.
EXP(number)
- number: It refers to a numeric value, often a floating-point or integer type, which is passed as an argument to the EXP function. The EXP function calculates Euler’s number (approximately 2.71828) raised to the power of this number. Null is returned if the provided number is null.
Example
Output
Explanation
The EXP function in Oracle returns e raised to the power of a specified number. In this case, EXP(1)
is calculated which is approximately 2.71828
. The dual
table is a pseudo-table which is useful for computations that require only a single row.