cbrt()
Published Jul 20, 2021Updated Dec 21, 2022
Contribute to Docs
The cbrt()
function returns the cube root of the argument.
Syntax
std::cbrt(n)
Example 1
Use cbrt()
to return the cube root of 27
:
#include <iostream>#include <cmath>int main() {double x = 27;double result;result = std::cbrt(x);std::cout << "The cube root of " << x << " is " << result << "\n";// Output: The cube root of 27 is 3}
All contributors
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.