MariaDB EXP() Function

In MariaDB, EXP() is a built-in function that returns e raised to the power of the given number.

e is the base of the natural logarithm, also known as the natural base, approximately equal to 2.71828. Please refer to LN() and LOG() for more details.

MariaDB EXP() Syntax

Here is the syntax of the MariaDB EXP() function:

EXP(number)

Parameters

number

Required. power value.

If you provide the wrong number of parameters, MariaDB will report an error: ERROR 1582 (42000): Incorrect parameter count in the call to native function 'EXP'.

Return value

The MariaDB EXP() function returns the natural constant e raised to the power of the given number.

If the parameter number is NULL, the EXP() function will return NULL.

MariaDB EXP() Examples

This statement shows the basic usage of the MariaDB EXP() function:

SELECT
    EXP(0),
    EXP(1),
    EXP(2),
    EXP(-1),
    EXP(-2),
    EXP(NULL)\G

Output:

   EXP(0): 1
   EXP(1): 2.718281828459045
   EXP(2): 7.38905609893065
  EXP(-1): 0.36787944117144233
  EXP(-2): 0.1353352832366127
EXP(NULL): NULL

Conclusion

In MariaDB, EXP() is a built-in function that returns e raised to the power of the given number.