阅读(3411) (19)

Python3 math.atanh()方法 - 求反双曲正切值

2023-03-15 15:11:11 更新

 math 模块 math 模块


描述

math.atanh(x) 返回 x 的反双曲正切值。

math.atanh(x) 的参数介于 -0.99 到 0.99 之间。


语法

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

math.atanh(x)

参数说明:

  • x -- 必需,介于 -0.99 和 0.99 之间的正数或负数。 如果 x 不是数字,则返回 ​TypeError​.

返回值

返回一个浮点数,表示 x 的反双曲正切值。


实例

以下实例返回数字的双曲正切值:

# 导入 math 包
import math

# 输出双曲正切值
print(math.atanh(0.59))
print(math.atanh(-0.12))

输出结果:

0.6776660677579618
-0.12058102840844402

Python math 模块 math 模块