The std::cbrt() is an inbuilt function in C++ STL which is used to calculate the cube root of number. It accepts a number as argument and returns the cube root of that number.
// Returns cube root num (num can be // of type int, double, long double or // long long type. // The return type is same as parameter // passed. cbrt(num)
Parameter: The parameter can be of int, double, long double or long long type.
Return Value: It returns the cube root of the number num. The datatype of returned cube root is same as that of the parameter passed except when an integer is passed as parameter. If the parameter passed is integral then the cbrt() function will return a value of type double.
Input : 8 Output : 2 Input : 9 Output : 2.08008
Below program illustrate the cbrt() function:
- Vector of Vectors in C++ STL with Examples
- Array of Vectors in C++ STL
- How to call some function before main() function in C++?
- Difference between Virtual function and Pure virtual function in C++
- cin get() in C++ with Examples
- Difference between Increment and Decrement Operators
- Map of Vectors in C++ STL with Examples
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples
- C++ program to print all Even and Odd numbers from 1 to N
- Reverse the content of a file and store it in another
- Minimum cells to be flipped to get a 2*2 submatrix with equal elements
- Nested Loops in C++ with Examples
- _Find_first() function in C++ bitset with Examples
- _Find_next() function in C++ bitset with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.