C++ cmath cbrt() function
Example
Return the cube root of different numbers:
cout << cbrt(0);
cout << cbrt(1);
cout << cbrt(27);
cout << cbrt(0.64);
cout << cbrt(-27);
Try it Yourself »
Definition and Usage
The cbrt()
function returns the cube root of a number.
The cbrt()
function is defined in the <cmath>
header file.
Syntax
One of the following:
cbrt(double number);
cbrt(float number);
Parameter Values
Parameter | Description |
---|---|
number | Required. Specifies a number. If the number is an integer type then it will be treated as a double . |
Technical Details
Returns: | A float value (if the argument is float) or double value (in any other case) representing the cube root of a number. |
---|