PostgreSQL Tutorial PostgreSQL Advanced PostgreSQL Database Account Management PostgreSQL References
PostgreSQL Tutorial PostgreSQL Advanced PostgreSQL Database Account Management PostgreSQL References

PostgreSQL ATANH() Function



The PostgreSQL ATANH() function returns inverse hyperbolic tangent of a value. The inverse hyperbolic tangent of x is defined as:

atanh

If the argument is not in range [-1, 1], then this function returns an error.

Syntax

ATANH(x)

Parameters

x Required. Specify the value.

Return Value

Returns the inverse hyperbolic tangent of the value.

Example 1:

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

SELECT ATANH(-1);
Result: -Infinity

SELECT ATANH(-0.5);
Result: -0.5493061443340548

SELECT ATANH(0);
Result: 0

SELECT ATANH(0.5);
Result: 0.5493061443340548

SELECT ATANH(1);
Result: Infinity

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 1-0.8
Data 2-0.5
Data 30
Data 40.5
Data 50.8

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

SELECT *, ATANH(x) AS ATANH_Value FROM Sample;

This will produce the result as shown below:

DataxATANH_Value
Data 1-0.8-1.0986122886681098
Data 2-0.5-0.5493061443340548
Data 300
Data 40.50.5493061443340548
Data 50.81.0986122886681098

❮ PostgreSQL Functions