Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 scalbnd32(_Decimal32 x, int n);
_Decimal64 scalbnd64(_Decimal64 x, int n);
_Decimal128 scalbnd128(_Decimal128 x, int n);
_Decimal32 scalbn(_Decimal32 x, int n); /* C++ only */
_Decimal64 scalbn(_Decimal64 x, int n); /* C++ only */
_Decimal128 scalbn(_Decimal128 x, int n); /* C++ only */
_Decimal32 scalblnd32(_Decimal32 x, long int n);
_Decimal64 scalblnd64(_Decimal64 x, long int n);
_Decimal128 scalblnd128(_Decimal128 x, long int n);
_Decimal32 scalbln(_Decimal32 x, long int n); /* C++ only */
_Decimal64 scalbln(_Decimal64 x, long int n); /* C++ only */
_Decimal128 scalbln(_Decimal128 x, long int n) /* C++ only */
The scalbn() and scalbln() families of functions compute (x * 10 raised to n) efficiently, not normally, by computing 10 raised to n explicitly.
The scalbn() and scalbln() families of functions return (x * 10 raised to n).
⁄* CELEBS68
This example illustrates the scalbnd128() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal128 x, y;
x = 7.2DL;
y = scalbnd128(x, 6000);
printf("scalbnd128(%DDf, 6000) = %DDe\n", x, y);
}