SQLite COSH() Function
The SQLite COSH() function returns hyperbolic cosine of a value. The hyperbolic cosine of x is defined as:
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:
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 cosine of values of column x.
SELECT *, COSH(x) AS COSH_Value FROM Sample;
This will produce the result as shown below:
Data | x | COSH_Value |
---|---|---|
Data 1 | 0 | 1.0 |
Data 2 | 0.5 | 1.12762596520638 |
Data 3 | 1 | 1.54308063481524 |
Data 4 | 1.5 | 2.35240961524325 |
Data 5 | 2 | 3.76219569108363 |
❮ SQLite Functions