| description | COS (Transact-SQL) | ||
|---|---|---|---|
| title | COS (Transact-SQL) | Microsoft Docs | ||
| ms.custom | |||
| ms.date | 07/24/2017 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine, sql-database, sql-data-warehouse, pdw | ||
| ms.reviewer | |||
| ms.technology | t-sql | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | c9fa8ae1-3373-4f3e-9b97-fa05077c1040 | ||
| author | cawrites | ||
| ms.author | chadam | ||
| monikerRange | >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDE sql-asdb-asdbmi-asa-pdw]
A mathematical function that returns the trigonometric cosine of the specified angle - measured in radians - in the specified expression.
Transact-SQL Syntax Conventions
COS ( float_expression )
[!INCLUDEsql-server-tsql-previous-offline-documentation]
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)
[!INCLUDEssSDWfull] 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