math.cosh(x)

本页内容
上一节: Ref_math_cos 下一节: Ref_math_degrees

Python math.cosh() 方法

Python math 模块

Python math.cosh(x) 返回 x 的双曲余弦值,相当于 (exp(number) + exp(-number)) / 2。

Python 版本: 1.4

语法

math.cosh() 方法语法如下:


示例

math.cosh(x)

参数说明:

  • x -- 必需,个正数或负数。如果 x 不是一个数字,返回 TypeError。

返回值

返回一个浮点数,表示一个数字的双曲余弦值。

==

以下实例返回不同数字的双曲余弦值:


示例

# 导入 math 包

import math

# 输出双曲余弦值

print (math.cosh(1))

print (math.cosh(8.90))

print (math.cosh(0))

print (math.cosh(1.52))

输出结果:


示例

1.5430806348152437
3665.986837772461
1.0
2.395468541047187

Python math 模块

上一节: Ref_math_cos 下一节: Ref_math_degrees
此页面最后编辑于2022年8月17日 (星期三) 21:51。