MySQL: EXP Function

MySQL EXP Function

In this guide, we will explain 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 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 :

  • 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 EXP function examples and explore how to use the EXP function.

For example:

mysql> SELECT EXP(0);
Result: 1

mysql> SELECT EXP(1);
Result: 2.718281828459045

mysql> SELECT EXP(2);
Result: 7.38905609893065

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

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply