fabsd32()、fabsd64()、fabsd128() - 浮動小数点絶対値の計算

標準

標準/拡張機能 C/C++ 依存項目
C/C++ DFP 両方 z/OS® V1.8

形式

#define __STDC_WANT_DEC_FP__
#include <math.h> 

_Decimal32  fabsd32(_Decimal32 x); 
_Decimal64  fabsd64(_Decimal64 x);
_Decimal128 fabsd128(_Decimal128 x);
_Decimal32  fabs(_Decimal32 x);    /* C++ only */
_Decimal64  fabs(_Decimal64 x);    /* C++ only */
_Decimal128 fabs(_Decimal128 x);   /* C++ only */

機能説明

fabs() 関数は、10 進数浮動小数点引数の絶対値を計算します。
注 :
  1. IEEE 10 進数浮動小数点を使用するためには、ハードウェアに 10 進数浮動小数点機能 がインストールされている必要があります。
  2. これらの関数は、IEEE 10 進数浮動小数点形式で機能します。詳細は、IEEE 2 進数浮動小数点を参照してください

戻り値

10 進数浮動小数点入力値の絶対値を戻します。

⁄* CELEBF75

   This example illustrates the fabsd128() function.

*⁄

#define  __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>

int main(void)
{
  _Decimal128 x, y;

  x = -5.6798DL;
  y = fabsd128(x);

  printf("fabsd128(%DDf) = %DDf¥n", x, y);
}

関連情報