標準/拡張機能 | C/C++ | 依存項目 |
---|---|---|
C/C++ DFP |
両方 | z/OS V1.10 |
#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 */
x の正接を計算します。ここで、x は、ラジアンで表されます。x が大きい場合、 結果において部分的な有効数字の消失が起こることがあります。
これらの関数は、IEEE 10 進数浮動小数点形式で機能します。詳細は、IEEE 10 進数浮動小数点を参照してください。
x の計算された正接を戻します。
正しい値がアンダーフローの原因になった場合には、ゼロが戻されます。結果 がオーバーフローする場合、±HUGE_VAL_D32、±HUGE_VAL_D64、または ±HUGE_VAL_D128 が戻されます。 アンダーフローとオーバーフローの両方の場合に、値 ERANGE が errno に保管されます。
⁄* 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);
}