メインコンテンツまでスキップ
バージョン: 26.x

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 |
+------------------------------+