Mysql Exp Function

MySQL: EXP Function

This tutorial explains how to use the MySQL EXP function with syntax and examples.

Description

The MySQL EXP function returns e raised to the power of number (or enumber).

Syntax

The syntax for the EXP function in MySQL is:

EXP( number )

Parameters or Arguments

number

The power to raise e to, so the formula would be enumber.

Note

  • e is the base of natural logarithms.
  • See also the LOG and LN functions.

Applies To

The EXP function can be used in the following versions of MySQL:

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let's look at some MySQL EXP function examples and explore how to use the EXP function in MySQL.

For example:

mysql> SELECT EXP(0);
Output: 1

mysql> SELECT EXP(1);
Output: 2.718281828459045

mysql> SELECT EXP(2);
Output: 7.38905609893065

mysql> SELECT EXP(-2);
Output: 0.1353352832366127