expd32(), expd64(), expd128() — Calculate exponential function

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  expd32(_Decimal32 x); 
_Decimal64  expd64(_Decimal64 x);
_Decimal128 expd128(_Decimal128 x);
_Decimal32  exp(_Decimal32 x);     /* C++ only */
_Decimal64  exp(_Decimal64 x);     /* C++ only */
_Decimal128 exp(_Decimal128 x);    /* C++ only */

General description

Calculates the exponent of x, defined as e**x, where e equals 2.17128128....
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

If successful, the function returns the calculated value.

If an overflow occurs, the function returns HUGE_VAL_D32, HUGE_VAL_D64, or HUGE_VAL_D128. If an underflow occurs, it returns 0. Both overflow and underflow set errno to ERANGE.

Example

/* CELEBE11

   This example illustrates the expd64() function.

*/

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

int main(void)
{
   _Decimal64 x, y;

   x = 5.0DD;
   y = expd64(x);

   printf("expd64(%Df) = %Df\n", x, y);
}