SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite COSH() Function



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

cosh

where e is an Euler's number.

Syntax

COSH(x)

Parameters

x Required. Specify the value.

Return Value

Returns the hyperbolic cosine of a value.

Example 1:

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

SELECT COSH(0);
Result: 1.0

SELECT COSH(1);
Result: 1.54308063481524

SELECT COSH(-1);
Result: 1.54308063481524

SELECT COSH(2);
Result: 3.76219569108363

SELECT COSH(-2);
Result: 3.76219569108363

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 cosine of values of column x.

SELECT *, COSH(x) AS COSH_Value FROM Sample;

This will produce the result as shown below:

DataxCOSH_Value
Data 101.0
Data 20.51.12762596520638
Data 311.54308063481524
Data 41.52.35240961524325
Data 523.76219569108363

❮ SQLite Functions