Use the Cbrt()
function from the math
package to find the cube root of a given number in Go.
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(math.Cbrt(8))
}
Output:
2
We use cookies
We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.
Help us grow this site 🚀. Disable your ad blocker to see non-intrusive ads
Use the Cbrt()
function from the math
package to find the cube root of a given number in Go.
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(math.Cbrt(8))
}
Output:
2
Thank you for being on our site 😊. If you like our tutorials and examples, please consider supporting us with a cup of coffee and we'll turn it into more great Go examples.
Have a great day!