quantexpd32(), quantexpd64(), quantexpd128() - Compute the quantum exponent
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.11 |
Format
#define __STDC_WANT_DEC_FP__
#include <math.h>
int quantexpd32(_Decimal32 x);
int quantexpd64(_Decimal64 x);
int quantexpd128(_Decimal128 x);
int quantexp(_Decimal32 x); /* C++ only */
int quantexp(_Decimal64 x); /* C++ only */
int qunatexp(_Decimal128 x); /* C++ only */
General description
The quantexp() functions compute the quantum exponent of a finite argument.
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.
- The "quantum" when referring to a finite decimal floating-point number is defined as the "magnitude of a value of one in the rightmost digit position of the significand". For example, pennies and dollars can be represented respectively as 1 * 10 with a quantum of -2 and 0, or, 1*10^-2 and 1*10^0. For more information on the term quantum, see z/Architecture Principles of Operation.
Returned value
The quantexp() functions return the quantum exponent of x.
If x is infinite or NaN, they compute INT_MIN and a domain error occurs.
Example
/* CELEBQ03
This example illustrates the quantexpd128() function.
*/
#define __STDC_WANT_DEC_FP__
#include <stdio.h>
#include <math.h>
void main(void)
{
_Decimal128 x, y;
x = 4.56DL;
y = quantexpd128(x);
printf("quantexpd128( %DDf ) = %DDf\n", x, y);
}