go math.Cosh(),双曲余弦

Cosh()方法语法

func Cosh(x float64) float64

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

Cosh returns the hyperbolic cosine of x.

Special cases are:

Cosh(±0) = 1
Cosh(±Inf) = +Inf
Cosh(NaN) = NaN

golang标准库math.Cosh()方法,接收一个float64参数x,并求取x的双曲正余弦,除此之外,Cosh(±0) = 1;Cosh(±Inf) = +Inf;Cosh(NaN) = NaN。


math.Cosh()方法实例代码

func main() {
	var cosh_v float64 = math.Cosh(6)
	fmt.Println(cosh_v)
}

运行go文件,得到输出:

201.7156361224559

全栈后端 / go语法 :













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