function
<cmath> <ctgmath>
acosh
double acosh (double x);
float acoshf (float x);
long double acoshl (long double x);
double acosh (double x);
float acosh (float x);
long double acosh (long double x);
double acosh (T x); // additional overloads for integral types
Compute arc hyperbolic cosine
Returns the nonnegative arc hyperbolic cosine of x, expressed in radians.
The arc hyperbolic cosine is the inverse operation of the hyperbolic cosine.
Header
<tgmath.h> provides a type-generic macro version of this function.
Parameters
- x
- Value whose arc hyperbolic cosine is computed.
If the argument is less than 1
, a domain error occurs.
Return Value
Nonnegative arc hyperbolic cosine of x, in the interval [0,+INFINITY] radians.
Note that the negative of this value is also a valid arc hyperbolic cosine of x
One radian is equivalent to 180/PI
degrees.
If a domain error occurs:
- And math_errhandling has MATH_ERRNO set: the global variable errno is set to EDOM.
- And math_errhandling has MATH_ERREXCEPT set: FE_INVALID is raised.
Example
1 2 3 4 5 6 7 8 9 10 11 12
|
/* acosh example */
#include <stdio.h> /* printf */
#include <math.h> /* acosh, exp, sinh */
int main ()
{
double param, result;
param = exp(2) - sinh(2);
result = acosh(param) ;
printf ("The arc hyperbolic cosine of %f is %f radians.\n", param, result);
return 0;
}
| |
Output:
The arc hyperbolic cosine of 3.762196 is 2.000000 radians.
|
See also
- cosh
- Compute hyperbolic cosine (function
)
- asinh
- Compute arc hyperbolic sine (function
)