exp2d32(), exp2d64(), exp2d128() — Calculate the base-2 exponential
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.11 |
Format
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 exp2d32(_Decimal32 x);
_Decimal64 exp2d64(_Decimal64 x);
_Decimal128 exp2d128(_Decimal128 x);
_Decimal32 exp2(_Decimal32 x); /* C++ only */
_Decimal64 exp2(_Decimal64 x); /* C++ only */
_Decimal128 exp2(_Decimal128 x); /* C++ only */
General description
The exp2() functions compute the base-2 exponential of x.
Notes:
- These functions work in IEEE decimal floating-point format. See IEEE decimal floating-pointIEEE Decimal Floating-Point for more information.
- To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.
Returned value
The exp2() functions return 2 to the power x.
Example
/* CELEBE14
This example illustrates the exp2d128() function.
*/
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
void main(void)
{
_Decimal128 x, y;
x = 4.785DL;
y = exp2d128(x);
printf("exp2d128(%DDf) = %DDf\n", x, y);
}