go Cbrt(),求三次方根
Cbrt()方法语法
func Cbrt(x float64) float64
go源码对Cbrt()方法的介绍:
Cbrt returns the cube root of x.
Special cases are:
Cbrt(±0) = ±0
Cbrt(±Inf) = ±Inf
Cbrt(NaN) = NaN
golang math标准库Cbrt()方法,可求取参数x的三次方根。除此之外,Cbrt(±0) = ±0;Cbrt(±Inf) = ±Inf;Cbrt(NaN) = NaN。
math.Cbrt()方法实例代码
func main() {
cbrt_num := math.Cbrt(27)
fmt.Println(cbrt_num)
}
运行go文件,得到输出:
3