In this PostgreSQL post explains how to use the PostgreSQL exp function with syntax and examples.
The PostgreSQL exp function returns e raised to the power of number (or enumber).
The syntax for the exp function in PostgreSQL is:
exp( number )
The power to raise e to. Equivalent to the formula enumber.
The exp function can be used in the following versions of PostgreSQL:
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)