Postgresql Exp Function

PostgreSQL: exp Function

In this PostgreSQL post explains how to use the PostgreSQL exp function with syntax and examples.

Description

The PostgreSQL exp function returns e raised to the power of number (or enumber).

Syntax

The syntax for the exp function in PostgreSQL is:

exp( number )

Parameters or Arguments

number

The power to raise e to. Equivalent to the formula enumber.

Note

  • e is the base of natural logarithms.

Applies To

The exp function can be used in the following versions of PostgreSQL:

  • PostgreSQL 9.4, PostgreSQL 9.3, PostgreSQL 9.2, PostgreSQL 9.1, PostgreSQL 9.0, PostgreSQL 8.4

Example

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

For example:

postgres=# SELECT exp(0);
 exp
-----

   1
(1 row)

postgres=# SELECT exp(1);
       exp
------------------

 2.71828182845904
(1 row)

postgres=# SELECT exp(2);
       exp
------------------

 7.38905609893065
(1 row)

postgres=# SELECT exp(-2);
        exp
-------------------

 0.135335283236613
(1 row)