| title | COS (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 07/24/2017 | ||
| ms.prod | sql-non-specified | ||
| ms.prod_service | database-engine, sql-database, sql-data-warehouse, pdw | ||
| ms.service | |||
| ms.component | t-sql|functions | ||
| ms.reviewer | |||
| ms.suite | sql | ||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | c9fa8ae1-3373-4f3e-9b97-fa05077c1040 | ||
| caps.latest.revision | 21 | ||
| author | edmacauley | ||
| ms.author | edmaca | ||
| manager | craigg | ||
| ms.workload | Inactive |
[!INCLUDEtsql-appliesto-ss2008-all-md]
Is a mathematical function that returns the trigonometric cosine of the specified angle, in radians, in the specified expression.
Transact-SQL Syntax Conventions
COS ( float_expression ) float_expression
Is an expression of type float.
float
The following example returns the COS of the specific 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]
The following example returns the COS of the specific angle.
SELECT COS(14.76) AS cosCalc1, COS(-0.1472738) AS cosCalc2; [!INCLUDEssResult]
cosCalc1 cosCalc2
-------- --------
-0.58 0.99