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

TANH

説明

xの双曲線正接を返します。

構文

TANH(<x>)

パラメータ

Parameterデスクリプション
<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 |
+------------------------------+