Skip to main content

COS

Description

Calculate the cosine of the parameter

Syntax

COS(<a>)

Parameters

ParameterDescription
<a>floating point number, the radian value of the parameter to calculate

Return Value

The cosine of the parameter <a>, expressed in radians.

Examples

select cos(1);
+---------------------+
| cos(1.0) |
+---------------------+
| 0.54030230586813977 |
+---------------------+
select cos(0);
+------------------------+
| cos(cast(0 as DOUBLE)) |
+------------------------+
| 1.0 |
+------------------------+
select cos(Pi());
+-----------+
| cos(pi()) |
+-----------+
| -1 |
+-----------+