Returns the cotangent of x, where x is the value in radians, only input and output are supported as double. Input null value will return null value.
COT(<x>)
| Parameter | Description |
|---|---|
<x> | The value for which the cotangent is to be calculated |
Returns a Double type value means the cotangent of x.
x is NaN, returns NaNx is positive or negative infinity, returns NaNx is NULL, returns NULLselect cot(1),cot(2),cot(1000);
+--------------------+----------------------+--------------------+ | cot(1) | cot(2) | cot(1000) | +--------------------+----------------------+--------------------+ | 0.6420926159343306 | -0.45765755436028577 | 0.6801221323348698 | +--------------------+----------------------+--------------------+
Input null value.
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 | +-----------------------------+