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

COT

説明

xのコタンジェント(余接)を返します。xはラジアン単位の値で、入力と出力はdoubleのみサポートされています。入力がnull値の場合はnull値を返します。

構文

COT(<x>)

パラメータ

Parameterデスクリプション
<x>コタンジェントを計算する値

戻り値

xのコタンジェントを表すDouble型の値を返します。

特殊なケース

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

select cot(1),cot(2),cot(1000);
+--------------------+----------------------+--------------------+
| cot(1) | cot(2) | cot(1000) |
+--------------------+----------------------+--------------------+
| 0.6420926159343306 | -0.45765755436028577 | 0.6801221323348698 |
+--------------------+----------------------+--------------------+

入力のnull値。

select cot(null);
+--------------------+
| cot(null) |
+--------------------+
| NULL |
+--------------------+
select cot(cast('nan' as double));
+----------------------------+
| cot(cast('nan' AS DOUBLE)) |
+----------------------------+
| NaN |
+----------------------------+
select cot(cast('inf' as double));
+----------------------------+
| cot(cast('inf' AS DOUBLE)) |
+----------------------------+
| NaN |
+----------------------------+
select cot(cast('-inf' as double));
+-----------------------------+
| cot(cast('-inf' AS DOUBLE)) |
+-----------------------------+
| NaN |
+-----------------------------+