Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP |
both | z/OS® V1.10 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 asind32(_Decimal32 x);
_Decimal64 asind64(_Decimal64 x);
_Decimal128 asind128(_Decimal128 x);
_Decimal32 asin(_Decimal32 x); /* C++ only */
_Decimal64 asin(_Decimal64 x); /* C++ only */
_Decimal128 asin(_Decimal128 x); /* C++ only */
Calculates the arcsine of x, in the range -pi/2 to pi/2 radians.
The value of x must be between -1 and 1.
These functions work in IEEE decimal floating-point format. See IEEE decimal floating-point for more information.
If successful, the function returns the arcsine of its argument x.
If x is less than -1 or greater than 1, the function sets errno to EDOM and returns NaNQ. No other errors will occur.
CELEBA13
⁄* CELEBA13
This example illustrates the asind128() function.
This example prompts for a value for x.
It prints an error message if x is greater than 1 or
less than -1; otherwise, it assigns the arcsine of
x to y.
*⁄
#define __STDC_WANT_DEC_FP__
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX 1.0DL
#define MIN -1.0DL
int main(void)
{
_Decimal128 x, y;
printf( "Enter x\n" );
scanf( "%DDf", &x );
⁄* Output error if not in range *⁄
if ( x > MAX )
printf( "Error: %f too large for asind128\n", x );
else if ( x < MIN )
printf( "Error: %f too small for asind128\n", x );
else {
y = asind128( x );
printf( "asind128( %DDf ) = %DDf\n", x, y );
}
}