ATANH
描述
返回x的反双曲正切值。如果x不在-1到1之间 (不包括-1和1),则返回NULL。
语法
ATANH(<x>)
参数
| 参数 | 描述 |
|---|---|
<x> | 需要计算反双曲正切值的数值 |
返回值
参数x的反双曲正切值。
特殊情况处理
- 当
x等于 0 时,返回 0 - 当
x等于 1 或 -1 时,返回NULL - 当
x超出 (-1, 1) 范围时,返回NULL - 当
x为 NaN 时,返回 NaN - 当
x为正无穷大或负无穷大时,返回NULL - 当
x为 NULL 时,返回 NULL
示例
select atanh(0.0);
+------------+
| atanh(0.0) |
+------------+
| 0 |
+------------+
select atanh(-1.0);
+-------------+
| atanh(-1.0) |
+-------------+
| NULL |
+-------------+
select atanh(1.0);
+------------+
| atanh(1.0) |
+------------+
| NULL |
+------------+
select atanh(0.5);
+--------------------+
| atanh(0.5) |
+--------------------+
| 0.5493061443340548 |
+--------------------+
select atanh(cast('nan' as double));
+---------------------------+
| atanh(cast('nan' AS DOUBLE)) |
+---------------------------+
| NaN |
+---------------------------+
select atanh(cast('inf' as double));
+---------------------------+
| atanh(cast('inf' AS DOUBLE)) |
+---------------------------+
| NULL |
+---------------------------+