Go Cbrt()
Published Jul 25, 2023
Contribute to Docs
The Cbrt() function returns the cube root of a given number of type float64.
Syntax
import math
cbrt = math.Cbrt(x)
Where Cbrt() function takes a single argument of type float64.
Example
package mainimport ("fmt""math")func main() {fmt.Printf("Cube root of 27 = %f", math.Sqrt(27))}
The output will be:
Cube root of 27 = 5.196152
Codebyte Example
The following example is runnable and demonstrates the usage of Cbrt() in several different cases:
Contribute to Docs
- 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.
Learn Go on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Learn how to use Go (Golang), an open-source programming language supported by Google!
- Beginner Friendly.6 hours