title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
COS (Transact-SQL) |
COS (Transact-SQL) |
markingmyname |
maghan |
07/24/2017 |
sql |
t-sql |
reference |
|
|
|
>= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest || >= sql-server-2016 || >= sql-server-linux-2017 || = azuresqldb-mi-current||=fabric |
[!INCLUDE sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw]
A mathematical function that returns the trigonometric cosine of the specified angle - measured in radians - in the specified expression.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
COS ( float_expression )
float_expression
An expression of type float.
float
This example returns the COS
value of the specified angle:
DECLARE @angle FLOAT;
SET @angle = 14.78;
SELECT 'The COS of the angle is: ' + CONVERT(VARCHAR,COS(@angle));
GO
[!INCLUDEssResult]
The COS of the angle is: -0.599465
(1 row(s) affected)
[!INCLUDEssazuresynapse-md] and [!INCLUDEssPDW]
This example returns the COS values of the specified angles:
SELECT COS(14.76) AS cosCalc1, COS(-0.1472738) AS cosCalc2;
[!INCLUDEssResult]
cosCalc1 cosCalc2
-------- --------
-0.58 0.99