fabsd32(), fabsd64(), fabsd128() — Calculate floating-point absolute value

Standards

Standards / Extensions C or C++ Dependencies
C/C++ DFP both z/OS® V1.8

Format

#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 */

General description

The fabs() functions calculate the absolute value of a decimal floating-point argument.
Notes:
  1. To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.
  2. These functions work in IEEE decimal floating-point format. See IEEE binary floating-point for more information

Returned value

Returns the absolute value of the decimal floating-point input.

Example

⁄* 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);
}

Related information