# C complex.h ccosh,ccoshf and ccoshl

The C <complex.h> ccosh,ccoshf and ccoshl function compute the hyperbolic cosine of the complex number.The declaration of the function is given below.

1 double complex ccosh(double complex z);
2 float complex ccoshf(float complex z);
3 long double complex ccoshl(long double complex z);

All the three functions compute the same value,the only difference between them is in their return type:

i)The ‘ccosh’ return the hyperbolic cosine as double complex type.
ii)The ‘ccoshf’ return the hyperbolic cosine as float complex type and
iii)The ‘ccoshl’ return the hyperbolic cosine as long double complex type.

some points to note::

i)The ccosh,ccoshf and ccoshl is computed using the formula :

“cosh=ccosh=ccoshf=ccoshl”

#### double complex ccosh(double complex z);

Parameters:
z – A complex number whose hyperbolic cosine is to be computed.

Return type
double complex -The complex hyperbolic cosine of ‘z’ as double type.

Code example

double complex c1=77.88 +I*77.88 , c2 ;

c2=ccosh( c1 ) ;

printf( “Real part of c2=%lf”, creal(c2) ) ;
printf( “\nImaginary part of c2=%lf”, cimag(c2) ) ;

Output in Code::blocks,

Real part of c2=-2627295778549933900000000000000000.000000
Imaginary part of c2=2038284095150976800000000000000000.000000

#### float complex ccoshf(float complex z);

This function return the hyperbolic cosine as float type.

Parameters:
z – A complex number whose hyperbolic cosine is to be computed.

Return type
float complex -The complex hyperbolic tangent of ‘z’ as float type.

Code example

float complex c1=77.88 +I*77.88 , c2 ;

c2=ccoshf( c1 ) ;

printf( “Real part of c2=%f”, crealf(c2) ) ;
printf( “\nImaginary part of c2=%f”, cimagf(c2) ) ;

Output in Code::blocks,

Real part of c2=-2627282930740450900000000000000000.000000
Imaginary part of c2=2038285760586433500000000000000000.000000

#### long double complex ccoshl(long double complex z);

This function return the hyperbolic cosine as long double type.

Parameters:
z – A complex number whose hyperbolic cosine is to be computed.

Return type
long double complex -The complex hyperbolic tangent of ‘z’ as long double type.

Code example

long double complex c1=77.88 +I*77.88 , c2 ;

c2=ccoshl( c1 ) ;

printf( “Real part of c2=%Lf”, creall(c2) ) ;
printf( “\nImaginary part of c2=%Lf”, cimagl(c2) ) ;

Output in Code::blocks,

Real part of c2=-2627282930740450900000000000000000.000000
Imaginary part of c2=2038285760586433500000000000000000.000000

*Side Note

Some cases of ccosh function (also holds true for ccoshf and ccoshl),

➥ccosh(conj(z))=conj(ccosh(z)) and ccosh is even.

➥ccosh(+0+i0) returns 1+i0.

➥ccosh(+0+i∞) returns NaN±i0(where the sign of the imaginary part of the result is unspecified) and raises the invalid floating-point exception.

➥ccosh(+0+iNaN) returns NaN±i0(where the sign of the imaginary part of the result is unspecified).

➥ccosh(x+i∞) returns NaN+iNaN and raises the invalid floating-point exception, for finite nonzero x.

➥ccosh(x+iNaN) returns NaN+iNaN and optionally raises the invalid floating-point exception, for finite nonzero x.

➥ccosh(+∞+i0) returns +∞+i0.

➥ccosh(+∞+iy) returns +∞±∞ , for finite nonzero y.

➥ccosh(+∞ + i∞) returns ±∞+i NaN (where the sign of the real part of the result is unspecified) and raises the in valid floating-point exception.

➥ccosh(+∞ + iNaN) returns +∞+iNaN.

➥ccosh(NaN+i0) returns NaN±i0 (where the sign of the imaginary part of the result is unspecified).

➥ccosh(NaN + iy) returns NaN+i NaN and optionally raises the in valid floating-point exception, for all nonzero numbers y.

➥ccosh(NaN + iNaN) returns NaN+iNaN.