SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite EXP() Function



The SQLite EXP() function returns e raised to the power of specified number, i.e., ex. Please note that e is the base of the natural system of logarithms, and its value is approximately 2.71828182845905.

Syntax

EXP(x)

Parameters

x Required. Specify the exponent of e.

Return Value

Returns e raised to the power of specified number.

Example 1:

The example below shows the usage of EXP() function.

SELECT EXP(0);
Result: 1.0

SELECT EXP(1);
Result: 2.71828182845905

SELECT EXP(-1);
Result: 0.367879441171442

SELECT EXP(2);
Result: 7.38905609893065

SELECT EXP(-2);
Result: 0.135335283236613

SELECT LN(EXP(1));
Result: 1.0

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 1-2
Data 2-1
Data 30
Data 41
Data 52

The statement given below can be used to calculate the exponent of records of column x.

SELECT *, EXP(x) AS EXP_Value FROM Sample;

This will produce the result as shown below:

DataxEXP_Value
Data 1-20.135335283236613
Data 2-10.367879441171442
Data 301.0
Data 412.71828182845905
Data 527.38905609893065

❮ SQLite Functions