PostgreSQL ACOSH() Function
The PostgreSQL ACOSH() function returns inverse hyperbolic cosine of a value. The inverse hyperbolic cosine of x is defined as:
If the argument is less than 1, then this function returns an error.
Syntax
ACOSH(x)
Parameters
x |
Required. Specify the value. |
Return Value
Returns the inverse hyperbolic cosine of the value.
Example 1:
The example below shows the usage of ACOSH() function.
SELECT ACOSH(1); Result: 0 SELECT ACOSH(2); Result: 1.3169578969248166 SELECT ACOSH(3); Result: 1.762747174039086 SELECT ACOSH(4); Result: 2.0634370688955608 SELECT ACOSH(5); Result: 2.2924316695611777
Example 2:
Consider a database table called Sample with the following records:
Data | x |
---|---|
Data 1 | 1 |
Data 2 | 5 |
Data 3 | 10 |
Data 4 | 50 |
Data 5 | 100 |
The statement given below can be used to calculate the inverse hyperbolic cosine of records of column x.
SELECT *, ACOSH(x) AS ACOSH_Value FROM Sample;
This will produce the result as shown below:
Data | x | ACOSH_Value |
---|---|---|
Data 1 | 1 | 0 |
Data 2 | 5 | 2.2924316695611777 |
Data 3 | 10 | 2.993222846126381 |
Data 4 | 50 | 4.6050701709847575 |
Data 5 | 100 | 5.298292365610484 |
❮ PostgreSQL Functions