cbrt, cbrtf, cbrtl
From cppreference.com
Defined in header <math.h>
|
||
float cbrtf( float arg ); |
(1) | (since C99) |
double cbrt( double arg ); |
(2) | (since C99) |
long double cbrtl( long double arg ); |
(3) | (since C99) |
Defined in header <tgmath.h>
|
||
#define cbrt( arg ) |
(4) | (since C99) |
1-3) Computes the cubic root of
arg
.4) Type-generic macro: If
arg
has type long double, cbrtl
is called. Otherwise, if arg
has integer type or the type double, cbrt
is called. Otherwise, cbrtf
is called.Parameters
arg | - | floating point value |
Return value
If no errors occur, the cubic root of arg
(3√arg), is returned.
If a range error occurs due to underflow, the correct result (after rounding) is returned.
Error handling
Errors are reported as specified in math_errhandling.
If the implementation supports IEEE floating-point arithmetic (IEC 60559),
- if the argument is ±0 or ±∞, it is returned, unchanged
- if the argument is NaN, NaN is returned.
Notes
cbrt(arg) is not equivalent to pow(arg, 1.0/3) because pow cannot raise a negative base to a fractional exponent.