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