SQLite TANH() Function
The SQLite TANH() function returns hyperbolic tangent of a value. The hyperbolic tangent of x is defined as:
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:
Data | x |
---|---|
Data 1 | 0 |
Data 2 | 0.5 |
Data 3 | 1 |
Data 4 | 1.5 |
Data 5 | 2 |
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:
Data | x | TANH_Value |
---|---|---|
Data 1 | 0 | 0.0 |
Data 2 | 0.5 | 0.46211715726001 |
Data 3 | 1 | 0.761594155955765 |
Data 4 | 1.5 | 0.905148253644866 |
Data 5 | 2 | 0.964027580075817 |
❮ SQLite Functions