| Types and the imaginary constant | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Manipulation | |||||||||||||||||||||||||||||||
| Power and exponential functions | |||||||||||||||||||||||||||||||
| Trigonometric functions | |||||||||||||||||||||||||||||||
| Hyperbolic functions | |||||||||||||||||||||||||||||||
Defined in header <complex.h> | ||
| (1) | (since C99) | |
| (2) | (since C99) | |
| (3) | (since C99) | |
Defined in header <tgmath.h> | ||
#define cosh( z ) | (4) | (since C99) |
z.z has typelongdoublecomplex,ccoshl is called. ifz has typedoublecomplex,ccosh is called, ifz has typefloatcomplex,ccoshf is called. Ifz is real or integer, then the macro invokes the corresponding real function (coshf,cosh,coshl). Ifz is imaginary, then the macro invokes the corresponding real version of the functioncos, implementing the formulacosh(iy) = cos(y), and the return type is real.Contents |
| z | - | complex argument |
If no errors occur, complex hyperbolic cosine ofz is returned
Errors are reported consistent withmath_errhandling
If the implementation supports IEEE floating-point arithmetic,
z is+0+0i, the result is1+0iz is+0+∞i, the result isNaN±0i (the sign of the imaginary part is unspecified) andFE_INVALID is raisedz is+0+NaNi, the result isNaN±0i (the sign of the imaginary part is unspecified)z isx+∞i (for any finite non-zero x), the result isNaN+NaNi andFE_INVALID is raisedz isx+NaNi (for any finite non-zero x), the result isNaN+NaNi andFE_INVALID may be raisedz is+∞+0i, the result is+∞+0iz is+∞+yi (for any finite non-zero y), the result is+∞cis(y)z is+∞+∞i, the result is±∞+NaNi (the sign of the real part is unspecified) andFE_INVALID is raisedz is+∞+NaN, the result is+∞+NaNz isNaN+0i, the result isNaN±0i (the sign of the imaginary part is unspecified)z isNaN+yi (for any finite non-zero y), the result isNaN+NaNi andFE_INVALID may be raisedz isNaN+NaNi, the result isNaN+NaNiwherecis(y) iscos(y) + i sin(y)
| ez +e-z |
| 2 |
Hyperbolic cosine is an entire function in the complex plane and has no branch cuts. It is periodic with respect to the imaginary component, with period 2πi
#include <stdio.h>#include <math.h>#include <complex.h> int main(void){doublecomplex z= ccosh(1);// behaves like real cosh along the real lineprintf("cosh(1+0i) = %f%+fi (cosh(1)=%f)\n",creal(z),cimag(z),cosh(1)); doublecomplex z2= ccosh(I);// behaves like real cosine along the imaginary lineprintf("cosh(0+1i) = %f%+fi ( cos(1)=%f)\n",creal(z2),cimag(z2),cos(1));}
Output:
cosh(1+0i) = 1.543081+0.000000i (cosh(1)=1.543081)cosh(0+1i) = 0.540302+0.000000i ( cos(1)=0.540302)
(C99)(C99)(C99) | computes the complex hyperbolic sine (function)[edit] |
(C99)(C99)(C99) | computes the complex hyperbolic tangent (function)[edit] |
(C99)(C99)(C99) | computes the complex arc hyperbolic cosine (function)[edit] |
(C99)(C99) | computes hyperbolic cosine (\({\small\cosh{x} }\)cosh(x)) (function)[edit] |
C++ documentation forcosh | |