Skip to main content
  1. Tutorials/

🧊 Cube root in Go

·1 min

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