Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

MySQL EXP() function

EXP() function

MySQL EXP() returns the value of the base of natural logarithm number e, raised to the power of a number specified as argument.

Syntax:

EXP(N);

Argument:

Name Description
N A number.

Syntax Diagram:

MySQL EXP() Function - Syntax Diagram

MySQL Version: 5.6


Pictorial presentation of MySQL EXP() function

pictorial presentation of MySQL EXP() function

Example of MySQL EXP() function

Code:

SELECT EXP(1);

Explanation:

The above MySQL statement will return the value of the natural logarithm base number e raised to the power of the given number.

Sample Output:

mysql> SELECT EXP(1);
+------------------+
| EXP(1)           |
+------------------+
| 2.71828182845905 | 
+------------------+
1 row in set (0.03 sec)

Example: EXP() function with negative value

Code:

SELECT EXP(-1);

Explanation:

The above MySQL statement will return the value of the natural logarithm base number e raised to the power of the given number.

Sample Output:

mysql> SELECT EXP(-1);
+-------------------+
| EXP(-1)           |
+-------------------+
| 0.367879441171442 | 
+-------------------+
1 row in set (0.00 sec)

All Mathematical Functions

MySQL Mathematical Functions, slide presentation

Previous: DIVISION
Next: FLOOR()