coshd32(), coshd64(), coshd128() - Calculate hyperbolic cosine

Standards

Standards / Extensions C or C++ Dependencies

C/C++ DFP

both z/OS® V1.10

Format

#define __STDC_WANT_DEC_FP__
#include <math.h>

_Decimal32  coshd32(_Decimal32 x);
_Decimal64  coshd64(_Decimal64 x);
_Decimal128 coshd128(_Decimal128 x);
_Decimal32  cosh(_Decimal32 x);     /* C++ only */
_Decimal64  cosh(_Decimal64 x);     /* C++ only */
_Decimal128 cosh(_Decimal128 x);    /* C++ only */

General description

Calculates the hyperbolic cosine of x. The value x is expressed in radians.

These functions work in IEEE decimal floating-point format. See IEEE decimal floating-point for more information.

Note: To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.

Returned value

If the result overflows, the function returns +HUGE_VAL_D32, +HUGE_VAL_D64 or +HUGE_VAL_D128 and sets errno to ERANGE.

Example

CELEBC51

⁄* CELEBC51

   This example illustrates the coshd128() function.

   This example calculates y to be the hyperbolic cosine of x.

*⁄

#define  __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>

int main(void)
{
   _Decimal128 x, y;

   x = 7.2DL;
   y = coshd128(x);

   printf("coshd128( %DDf ) = %DDf\n", x, y);
}

Related information