EXP
EXP(X)
Section titled “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
Section titled “Example”SELECT EXP(1);Output
Section titled “Output”2.718281828459045Explanation
Section titled “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 )
Section titled “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
Section titled “Example”SELECT EXP(1) AS ExponentialOutput;Output
Section titled “Output”ExponentialOutput-----------------2.71828182845905Explanation
Section titled “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)
Section titled “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
Section titled “Example”SELECT EXP(1) FROM dual;Output
Section titled “Output”2.71828182846Explanation
Section titled “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.