SQLite 3 reference · Math Functions
SQLite EXP() Function
Return e (about 2.718) raised to a power, so exp(1) is e. It is the inverse of the ln() function.
SQLite 3 Since 3.35.0
Syntax
exp(X)
Parameters
| Parameter | Description |
|---|---|
X |
A number (text that looks like a number is converted). |
Return value
A floating-point number.
Examples
SELECT exp(0) AS a, round(exp(1), 5) AS e;
Output
a | e 1 | 2.71828
Run this on your computer — see “Get Started” for setup.
SELECT round(exp(ln(42)), 6) AS back_again;
Output
back_again 42
Run this on your computer — see “Get Started” for setup.
This is one of SQLite's built-in math functions, available since 3.35.0 when SQLite is compiled with
SQLITE_ENABLE_MATH_FUNCTIONS (the default for the sqlite3 command-line tool and most language bindings). The
in-browser SQLite on this site is built without them, so the examples show output from standard SQLite instead.
Version history
| Version | Change |
|---|---|
| SQLite 3.35.0 | Added |
In other languages
LN()· PostgreSQL
Related
LN()· Return the natural logarithm (base e) of a number. Zero or negative numbers give NULL.POWER()· Raise a number to a power, so power(2, 10) is 1024. pow() is another name for the same function.- SQL Aggregate Functions · tutorial