Cloud

exp

The exp() function returns the exponential value of a number specified in the argument.

Syntax

The syntax for the exp() is:

EXP(number);

Where:

  • number: The number for which to calculate the exponential value. Equivalent to the formula e^number.

Examples

The examples here show how the exp() function works.

Basic usage

This example uses the exp() function with positive and negative values.

SELECT EXP(0) AS "EXP of 0",
      EXP(1) AS "EXP of 1",
      EXP(2) AS "EXP of 2",
      EXP(-1) AS "EXP of -1",
      EXP(-2) AS "EXP of -2";

The query returns:

EXP of 0  |     EXP of 1      |     EXP of 2     |      EXP of -1      |     EXP of -2
----------+-------------------+------------------+---------------------+--------------------
        1 | 2.718281828459045 | 7.38905609893065 | 0.36787944117144233 | 0.1353352832366127

Use exp() with fractions

This case uses the exp() function with a fractional argument.

SELECT EXP(3.2);

Here is the result:

        exp
--------------------
 24.532531366911574

Use exp() with expressions

This example uses the exp() function with expressions.

SELECT EXP(5 * 5);

The query returns:

        exp
-------------------
 72004899337.38588