Python math.cosh() 方法
实例
求不同数字的双曲余弦:
# Import math Libraryimport math# Return the hyperbolic cosine of different numbersprint (math.cosh(1))print (math.cosh(8.90))print (math.cosh(0))print (math.cosh(1.52))
定义与用法
math.cosh() 方法返回数字的双曲余弦(相当于(exp(number)+exp(-number))/2)。
语法
math.cosh(x)
参数值
| 参数 | 描述 |
|---|---|
| x | 必填。求其双曲余弦的数字。如果该值不是数字,则返回 TypeError |
技术细节
| 返回值: | 一个 float 值,表示数字的双曲余弦 |
|---|---|
| Python 版本: | 1.4 |