COS
Synopsis
{fn COS(float-expression)}
Arguments
Argument | Description |
---|---|
float-expression | An expression of type FLOAT. This is an angle expressed in radians. |
Description
COS takes any numeric value and returns the cosine as a floating point number. The returned value is within the range -1 to 1, inclusive. COS returns NULL if passed a NULL value. COS treats nonnumeric strings as the numeric value 0.
COS returns a value of data type FLOAT with a precision of 19 and a scale of 18.
COS can only be used as an ODBC scalar function (with the curly brace syntax).
You can use the DEGREES function to convert radians to degrees. You can use the RADIANS function to convert degrees to radians.
Examples
These examples show the effect of COS on two sines.
SELECT {fn COS(0.52)} AS Cosine
returns 0.86781.
SELECT {fn COS(-.31)} AS Cosine
returns 0.95233.