ACOS (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![yes](media/yes.png)Azure SQL Data Warehouse ![yes](media/yes.png)Parallel Data Warehouse

A function that returns the angle, in radians, whose cosine is the specified float expression. This is also called arccosine.

Topic link icon Transact-SQL Syntax Conventions

Syntax

ACOS ( float_expression )  

Arguments

float_expression
An expression of either type float or of a type that can implicitly convert to float. Only a value ranging from -1.00 to 1.00 is valid. Values outside this range return NULL, and ASIN will report a domain error.

Return Types

float

Examples

This example returns the ACOS value of the specified number.

SET NOCOUNT OFF;  
DECLARE @cos float;  
SET @cos = -1.0;  
SELECT 'The ACOS of the number is: ' + CONVERT(varchar, ACOS(@cos));  

Here is the result set.

---------------------------------   
The ACOS of the number is: 3.14159   
  
(1 row(s) affected)  

See also

Mathematical Functions (Transact-SQL)
Functions