Skip to content
本页内容

Tanh (方法)

返回某一数字的双曲正切值。

参数

属性数据类型必填说明
Arg1float必填Number - 任意实数。

返回值

float

示例

python
#本示例使用 Tanh 方法计算数值1和2.5的双曲正切值,并分别赋值给B2和B3单元格
def test():
    Range("B2").Value2 = WorksheetFunction.Tanh(1)
    Range("B3").Value2 = WorksheetFunction.Tanh(2.5)
python
#本示例为A3单元格赋值,使用 Tanh 方法计算其双曲正切值
def test():
    Range("A3").Value2 = -1
    print(WorksheetFunction.Tanh(Range("A3").Value2))