SQL Server EXP() Function

The EXP() function in SQL Server calculates the exponential value of a number. It uses the mathematical constant *e* (Euler's number) as the base. In simpler terms, it raises *e* to the power of the number you provide.



EXP(): Definition and Usage

The constant *e*, approximately 2.71828, is the base of natural logarithms. The EXP() function is frequently used in mathematical and scientific computations, particularly in cases involving exponential growth or decay.

Related Function

For the inverse operation (finding the natural logarithm of a number), see the LOG() function.

Syntax

Syntax

EXP(number)
      

Parameter Values

Parameter Description
number The exponent (the power to which *e* is raised). This is a required numeric value.

Examples

Calculating e to the Power of 1

This calculates *e*1, which is simply *e* itself.

Syntax

SELECT EXP(1);
      
Output

2.71828182845905
      

Calculating e to the Power of 2

This calculates *e*2.

Syntax

SELECT EXP(2);
      
Output

7.38905609893065
      

**Note:** The output values are approximate due to floating-point limitations. The exact values might vary very slightly depending on your SQL Server version.