scalbnd32(), scalbnd64(), scalbnd128() and scalblnd32(), scalblnd64(), scalblnd128() — Load exponent functions
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 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 */
General description
The scalbn() and scalbln() families of functions compute (x * 10 raised to n) efficiently, not normally, by computing 10 raised to n explicitly.
Notes:
- To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.
- These functions work in IEEE decimal floating-point format. See "IEEE Decimal Floating-Point" for more information.
Returned value
The scalbn() and scalbln() families of functions return (x * 10 raised to n).
Example
/* 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);
}
Related information
- math.h
- expd32(), expd64(), expd128() — Calculate exponential function
- frexpd32(), frexpd64(), frexpd128() — Extract mantissa and exponent of the decimal floating-point value
- ilogbd32(), ilogbd64(), ilogbd128() — Integer unbiased exponent
- ldexpd32(), ldexpd64(), ldexpd128() — Multiply by a power of ten
- logd32(), logd64(), logd128() — Calculate natural logarithm
- log10d32(), log10d64(), log10d128() — Calculate base 10 logarithm
- modfd32(), modfd64(), modfd128() — Extract fractional and integral parts of decimal floating-point value
- scalbn(), scalbnf(), scalbnl(), scalbln(), scalblnf(), scalblnl() — Load exponent functions