Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

COS Function

COS is a trigonometric function that returns the cosine of a number. The return value is in radians and is between PI/2 and -PI/2.

Syntax

Copy
COS(double_precision)

Argument

number

The input parameter is a double precision number.

Return Type

The COS function returns a double precision number.

Examples

The following example returns cosine of 0:

Copy
select cos(0); cos ----- 1 (1 row)

The following example returns the cosine of PI:

Copy
select cos(pi()); cos ----- -1 (1 row)