ACOS (Transact-SQL)

Applies to: yesSQL Server (all supported versions) YesAzure SQL Database YesAzure SQL Managed Instance yesAzure Synapse Analytics yesParallel 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 )  

Note

To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.

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