__cospid32(), __cospid64(), __cospid128() — Calculate cosine of pi *x

Standards

Standards / Extensions C or C++ Dependencies
Language Environment® both z/OS® V1.8

Format

#define __STDC_WANT_DEC_FP__
#include <math.h>

_Decimal32  __cospid32(_Decimal32 x); 
_Decimal64  __cospid64(_Decimal64 x);
_Decimal128 __cospid128(_Decimal128 x);

General description

Calculates the cosine of pi * x. The value x is expressed in radians.
Notes:
  1. To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.
  2. These functions work in IEEE decimal floating-point format. See "IEEE Decimal Floating-Point" for more information.

Returned value

Returns the calculated value.

If x is outside the prescribed limits, the value is not calculated. Instead, the function either returns 1, or returns 0 and sets errno to ERANGE.

Example

⁄* CELEBC49

   This example illustrates the __cospid32() function.

*⁄

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

int main(void)
{
   _Decimal32 x, y;

   x = 1.0DF;
   y = __cospid32(x);

   printf("__cospid32(%Hf) = %Hf\n", x, y);
}

Related information