sind32(), sind64(), sind128() — Calculate sine

Standards

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

Format

#define __STDC_WANT_DEC_FP__
#include <math.h>

_Decimal32  sind32(_Decimal32 x); 
_Decimal64  sind64(_Decimal64 x);
_Decimal128 sind128(_Decimal128 x);
_Decimal32  sin(_Decimal32 x);       /* C++ only */
_Decimal64  sin(_Decimal64 x);       /* C++ only */
_Decimal128 sin(_Decimal128 x);      /* C++ only */

General description

Calculates the sine of 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.

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

Example

⁄* CELEBS69

   This example illustrates the sind32() function.

*⁄

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

int main(void)
{
   _Decimal32 pi, x, y;

   pi = 3.141593DF;
   x = pi⁄2.0DF;
   y = sind32(x);

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

Related information