Related Articles
EXP() Function in SQL Server
• Last Updated : 29 Dec, 2020

EXP() function :

This function in SQL Server is used to return a value which is e raised to the nth power, where n is a specified number. Here “e” is a mathematical constant and the base of natural logarithms whose value is 2.7182818 and n is the input number taken as the parameter of the function.

Features :

This function is used to find a value which is e raised to the nth power.

Here the value n, is taken as the parameter of the function.

Here “e” is a mathematical constant and the base of natural logarithms whose value is “2.7182818”.

This function use the formula “(e)n = Returned value“.

Syntax :

`SELECT EXP(number);`

Parameter :

This method accepts a parameter as given below:

• number: Specified power number.

Returns :

It returns a value which is “e” raised to the nth power, where n is a specified number.

Example-1 :

Getting value 1.0 which is “e” raised to the 0th power.

`SELECT EXP(0);`

Output :

`1.0`

Example-2 :

Getting value 2.7182818284590451 which is “e” raised to the 1st power.

`SELECT EXP(1) As New;`

Output :

`2.7182818284590451`

Example-3 :

Using EXP() function with a variable and getting value 11.023176380641601 which is “e” raised to the (2.4)th power.

```DECLARE @Parameter_Value Float;
SET @Parameter_Value = 2.4;
SELECT EXP(@Parameter_Value);```

Output :

`11.023176380641601`

Example-4 :

Using EXP() function with a variable and getting value 0.1353352832366127 which is “e” raised to the (-2)nd power.

```DECLARE @Parameter_Value int;
SET @Parameter_Value = -2;
SELECT EXP(@Parameter_Value);```

Output :

`0.1353352832366127`

Application :

This function is used to return a value which is “e” raised to the nth power, where n is a specified number.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up