|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <math.h> | ||
float acoshf(float arg); | (1) | (since C99) |
double acosh(double arg); | (2) | (since C99) |
longdouble acoshl(longdouble arg); | (3) | (since C99) |
Defined in header <tgmath.h> | ||
#define acosh( arg ) | (4) | (since C99) |
acoshl is called. Otherwise, if the argument has integer type or the typedouble,acosh is called. Otherwise,acoshf is called. If the argument is complex, then the macro invokes the corresponding complex function (cacoshf,cacosh,cacoshl).Contents |
| arg | - | floating-point value representing the area of a hyperbolic sector |
If no errors occur, the inverse hyperbolic cosine ofarg (cosh-1
(arg), orarcosh(arg)) on the interval[0, +∞], is returned.
If a domain error occurs, an implementation-defined value is returned (NaN where supported).
Errors are reported as specified inmath_errhandling.
If the argument is less than1, a domain error occurs.
If the implementation supports IEEE floating-point arithmetic (IEC 60559),
Although the C standard names this function "arc hyperbolic cosine", the inverse functions of the hyperbolic functions are the area functions. Their argument is the area of a hyperbolic sector, not an arc. The correct name is "inverse hyperbolic cosine" (used by POSIX) or "area hyperbolic cosine".
#include <errno.h>#include <fenv.h>#include <float.h>#include <math.h>#include <stdio.h>// #pragma STDC FENV_ACCESS ON int main(void){printf("acosh(1) = %f\nacosh(10) = %f\n", acosh(1), acosh(10));printf("acosh(DBL_MAX) = %f\nacosh(Inf) = %f\n", acosh(DBL_MAX), acosh(INFINITY)); // error handlingerrno=0;feclearexcept(FE_ALL_EXCEPT);printf("acosh(0.5) = %f\n", acosh(0.5));if(errno==EDOM)perror(" errno == EDOM");if(fetestexcept(FE_INVALID))puts(" FE_INVALID raised");}
Possible output:
acosh(1) = 0.000000acosh(10) = 2.993223acosh(DBL_MAX) = 710.475860acosh(Inf) = infacosh(0.5) = -nan errno == EDOM: Numerical argument out of domain FE_INVALID raised
(C99)(C99)(C99) | computes inverse hyperbolic sine (\({\small\operatorname{arsinh}{x} }\)arsinh(x)) (function)[edit] |
(C99)(C99)(C99) | computes inverse hyperbolic tangent (\({\small\operatorname{artanh}{x} }\)artanh(x)) (function)[edit] |
(C99)(C99) | computes hyperbolic cosine (\({\small\cosh{x} }\)cosh(x)) (function)[edit] |
(C99)(C99)(C99) | computes the complex arc hyperbolic cosine (function)[edit] |
C++ documentation foracosh | |
| Weisstein, Eric W. "Inverse Hyperbolic Cosine." From MathWorld — A Wolfram Web Resource. |