Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP |
both | z/OS® V1.10 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 atand32(_Decimal32 x);
_Decimal64 atand64(_Decimal64 x);
_Decimal128 atand128(_Decimal128 x);
_Decimal32 atan(_Decimal32 x); /* C++ only */
_Decimal64 atan(_Decimal64 x); /* C++ only */
_Decimal128 atan(_Decimal128 x); /* C++ only */
_Decimal32 atan2d32(_Decimal32 y, _Decimal32 x);
_Decimal64 atan2d64(_Decimal64 y, _Decimal64 x);
_Decimal128 atan2d128(_Decimal128 y, _Decimal128 x);
_Decimal32 atan2(_Decimal32 y, _Decimal32 x); /* C++ only */
_Decimal64 atan2(_Decimal64 y, _Decimal64 x); /* C++ only */
_Decimal128 atan2(_Decimal128 y, _Decimal128 x); /* C++ only */
The atan() and atan2() functions calculate the arctangent of x and y/x, respectively.
These functions work in IEEE decimal floating-point format. See IEEE decimal floating-point for more information.
Returns a value in the range -pi/2 to pi/2 radians.
If both arguments of atan2() are zero, the function sets errno to EDOM and returns 0. No other errors will occur.
CELEBA15
⁄* CELEBA15
This example illustrates the atand64() and atan2d64() functions.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal64 a,b,c,d;
c = 0.45DD;
d = 0.23DD;
a = atand64(c);
b = atan2d64(c,d);
printf("atand64( %Df ) = %Df\n", c, a);
printf("atan2d64( %Df, %Df ) = %Df\n", c, d, b);
}