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