メインコンテンツまでスキップ
に最終更新

TAN

説明​

ラジアン単位の値 x の正接を返します。

構文​

TAN(<x>)

パラメータ​

パラメータ説明
<x>正接を計算する値

戻り値​

x の正接を返します。

特殊なケース​

  • x が NaN の場合、NaN を返します
  • x が正または負の無限大の場合、NaN を返します
  • x が NULL の場合、NULL を返します

例​

select tan(0),tan(1),tan(-1);
+------------------------+------------------------+-------------------------+
| tan(cast(0 as DOUBLE)) | tan(cast(1 as DOUBLE)) | tan(cast(-1 as DOUBLE)) |
+------------------------+------------------------+-------------------------+
| 0 | 1.5574077246549023 | -1.5574077246549023 |
+------------------------+------------------------+-------------------------+
select tan(cast('nan' as double));
+----------------------------+
| tan(cast('nan' AS DOUBLE)) |
+----------------------------+
| NaN |
+----------------------------+
select tan(cast('inf' as double));
+----------------------------+
| tan(cast('inf' AS DOUBLE)) |
+----------------------------+
| NaN |
+----------------------------+
select tan(cast('-inf' as double));
+-----------------------------+
| tan(cast('-inf' AS DOUBLE)) |
+-----------------------------+
| NaN |
+-----------------------------+