tand32(), tand64(), tand128() - Calculate tangent
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 tand32(_Decimal32 x);
_Decimal64 tand64(_Decimal64 x);
_Decimal128 tand128(_Decimal128 x);
_Decimal32 tan(_Decimal32 x); /* C++ only */
_Decimal64 tan(_Decimal64 x); /* C++ only */
_Decimal128 tan(_Decimal128 x); /* C++ only */
General description
Calculates the tangent of x, where x is expressed in radians. If x is large, a partial loss of significance in the result can occur.
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 the calculated tangent of x.
If the correct value would cause underflow, zero is returned. If the result overflows, ±HUGE_VAL_D32, ±HUGE_VAL_D64, or ±HUGE_VAL_D128 is returned. For both underflow and overflow, the value ERANGE is stored in errno.
Example
CELEBT22
/* CELEBT22
This example illustrates the tand64() function.
This example computes x as the tangent of PI/4.
*/
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal64 pi, x;
pi = 3.1415926DD;
x = tand64(pi/4.0DD);
printf("tand64( %Df ) is %Df\n", pi/4.0DD, x);
}
Related information
- math.h
- atanh(), atanhf(), atanhl() — Calculate hyperbolic arctangent
- acosd32(), acosd64(), acosd128() - Calculate arccosine
- acoshd32(), acoshd64(), acoshd128() - Calculate hyperbolic arccosine
- asind32(), asind64(), asind128() - Calculate arcsine
- asinhd32(), asinhd64(), asinhd128() - Calculate hyperbolic arcsine
- atand32(), atand64(), atand128(), atan2d32(), atan2d64(), atan2d128() - Calculate arctangent
- 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
- tanhd32(), tanhd64(), tanhd128() - Calculate hyperbolic tangent