atand32(), atand64(), atand128(), atan2d32(), atan2d64(), atan2d128() - Calculate arctangent
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP |
both | z/OS® V1.10 |
Format
#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 */
General description
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.
Note: To
use IEEE decimal floating-point, the hardware must have the Decimal
Floating-Point Facility installed.
Returned value
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.
Example
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);
}
Related information
- math.h
- acosd32(), acosd64(), acosd128() - Calculate arccosine
- acoshd32(), acoshd64(), acoshd128() - Calculate hyperbolic arccosine
- asind32(), asind64(), asind128() - Calculate arcsine
- asinhd32(), asinhd64(), asinhd128() - Calculate hyperbolic arcsine
- atanhd32(), atanhd64(), atanhd128() - Calculate hyperbolic arctangent
- cosd32(), cosd64(), cosd128() — Calculate cosine
- coshd32(), coshd64(), coshd128() - Calculate hyperbolic cosine
- sind32(), sind64(), sind128() — Calculate sine
- sinhd32(), sinhd64(), sinhd128() - Calculate hyperbolic sine
- tand32(), tand64(), tand128() - Calculate tangent
- tanhd32(), tanhd64(), tanhd128() - Calculate hyperbolic tangent