go Log2()

Log2()方法语法

func Log2(x float64) float64

go源码对Log2()方法的介绍:

Log2 returns the binary logarithm of x. The special cases are the same as for Log

golang标准库模块math.Log2()方法,求取的是以2为底数的参数x的对数值。除此之外,special cases与Log()方法的相似。


math.Log2()方法实例代码

func main() {
	log2_v := math.Log2(1.2)
	fmt.Println(log2_v)
}

运行go文件,得到输出:

0.2630344058337938

全栈后端 / go语法 :













Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.