Implementation status: to be implemented


#include <math.h>

double acosh(double x);
float acoshf(float x);
long double acoshl(long double x);


The function computes the inverse hyperbolic cosine of its argument x.

An application wishing to check for error situations should set errno to zero and call feclearexcept (FE_ALL_EXCEPT) before calling this function. On return, if errno is non-zero or fetestexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.

x - an argument for which inverse hyperbolic cosine is computed.

Return value

Upon successful completion, this function returns the inverse hyperbolic cosine of its argument.

For finite values of x < 1, a domain error occurs and NaN is returned.
If x is NaN, a NaN is returned.
If x is +1, +0 is returned.
If x is +Inf, +Inf is returned.
If x is -Inf, a domain error occurs, and a NaN is returned.


[EDOM] (Domain Error) - The x argument is finite and less than +1.0 or is -Inf.
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno is set to [EDOM]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception is raised.


On error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero.