Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.11 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 cbrtd32(_Decimal32 x);
_Decimal64 cbrtd64(_Decimal64 x);
_Decimal128 cbrtd128(_Decimal128 x);
_Decimal32 cbrt(_Decimal32 x); /* C++ only */
_Decimal64 cbrt(_Decimal64 x); /* C++ only */
_Decimal128 cbrt(_Decimal128 x); /* C++ only */
The cbrt() function calculates the real cube root of its argument x.
⁄* CELEBC52
This example illustrates the cbrtd64() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
void main(void)
{
_Decimal64 x, y;
x = 1000.0DD;
y = cbrtd64(x);
printf("cbrtd64( %Df ) = %Df\n", x, y);
}
The cbrt functions return x to the 1/3 power.
cbrt() does not fail.