MySQL EXP() Function

The EXP() function in MySQL calculates the exponential value of a number, using the mathematical constant *e* (Euler's number) as the base. In simpler terms, it raises *e* to the power of the given number.



EXP(): Definition and Usage

The constant *e*, approximately equal to 2.71828, is the base of the natural logarithm. The EXP() function is a fundamental mathematical function frequently used in various calculations, particularly in areas involving exponential growth or decay.

Related Functions

For related logarithmic operations, see also the LOG() (logarithm base 10) and LN() (natural logarithm) functions.

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 example calculates *e*1, which is simply *e* itself.

Syntax

SELECT EXP(1);
      
Output

2.718281828459045
      

Calculating e to the Power of 2

This example calculates *e*2.

Syntax

SELECT EXP(2);
      
Output

7.38905609893065