MySQL EXP() Function
In MySQL, the EXP()
function returns the value of the natural constant e
raised to the power of the specified value, for example, the EXP(2)
returns e2
e
is the base of the natural logarithm, also known as the natural base, see LN()
function and LOG()
function for more information.
EXP()
Syntax
Here is the syntax of MySQL EXP()
function:
EXP(number)
Parameters
number
- Required. The exponent to raise
e
to.
Return value
In MySQL, the EXP()
function returns the value of the natural constant e
raised to the power of the specified value.
If the parameter is NULL
, the EXP()
function will return NULL
.
EXP()
Examples
SELECT
EXP(0),
EXP(1),
EXP(2),
EXP(-1),
EXP(-2),
EXP(NULL)\G
output
*************************** 1\. row ***************************
EXP(0): 1
EXP(1): 2.718281828459045
EXP(2): 7.38905609893065
EXP(-1): 0.36787944117144233
EXP(-2): 0.1353352832366127
EXP(NULL): NULL