TANH
描述
返回 x 的双曲正切值。
语法
TANH(<x>)
参数
参数 | 说明 |
---|---|
<x> | 需要被计算双曲正切值 |
返回值
参数 x 的双曲正切值。
特殊情况
- 当
x
为NaN
,返回NaN
- 当
x
为正无穷,返回1
- 当
x
为负无穷,返回-1
- 当
x
为NULL
,返回NULL
举例
select tanh(0),tanh(1);
+-------------------------+-------------------------+
| tanh(cast(0 as DOUBLE)) | tanh(cast(1 as DOUBLE)) |
+-------------------------+-------------------------+
| 0 | 0.7615941559557649 |
+-------------------------+-------------------------+
select tanh(cast('nan' as double));
+----------------------------+
| tanh(cast('nan' AS DOUBLE))|
+----------------------------+
| NaN |
+----------------------------+
select tanh(cast('inf' as double));
+----------------------------+
| tanh(cast('inf' AS DOUBLE))|
+----------------------------+
| 1 |
+----------------------------+
select tanh(cast('-inf' as double));
+-----------------------------+
| tanh(cast('-inf' AS DOUBLE))|
+-----------------------------+
| -1 |
+-----------------------------+