__sinpid32(), __sinpid64(), __sinpid128() — Calculate sine 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  __sinpid32(_Decimal32 x); 
_Decimal64  __sinpid64(_Decimal64 x);
_Decimal128 __sinpid128(_Decimal128 x);

General description

Calculates the sine of pi * x, with x 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

If successful, the function returns the calculated value, expressed as a _Decimal32, _Decimal64, or _Decimal128 number.

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

Example

/* CELEBS70

   This example illustrates the __sinpid64() function.

*/

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

int main(void)
{
   _Decimal64 x, y;

   x = 0.5DD;
   y = __sinpid64(x);

   printf("__sinpid64(%Df) = %Df\n", x, y);
}

Related information