SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite TANH() Function



The SQLite TANH() function returns hyperbolic tangent of a value. The hyperbolic tangent of x is defined as:

tanh

where e is an Euler's number.

Syntax

TANH(x)

Parameters

x Required. Specify the value.

Return Value

Returns the hyperbolic tangent of a value.

Example 1:

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

SELECT TANH(0);
Result: 0.0

SELECT TANH(1);
Result: 0.761594155955765

SELECT TANH(-1);
Result: -0.761594155955765

SELECT TANH(2);
Result: 0.964027580075817

SELECT TANH(-2);
Result: -0.964027580075817

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 10
Data 20.5
Data 31
Data 41.5
Data 52

The statement given below can be used to calculate the hyperbolic tangent of values of column x.

SELECT *, TANH(x) AS TANH_Value FROM Sample;

This will produce the result as shown below:

DataxTANH_Value
Data 100.0
Data 20.50.46211715726001
Data 310.761594155955765
Data 41.50.905148253644866
Data 520.964027580075817

❮ SQLite Functions