Standard library / math

math.Cbrt()

Real cube root, including negative inputs. Expected stdout: '-3\n'.

Formal Syntax & Structure

go syntaxgo
func Cbrt(x float64) float64

Parameters & Attributes

NameTypeDescription
xfloat64First input operand (or sole input if unary).

Return Value

float64

Real cube root, including negative inputs.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(math.Cbrt(-27))}
Go Reference