ACOS (Transact-SQL)

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) SQL analytics endpoint in Microsoft Fabric Warehouse in Microsoft Fabric

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

Transact-SQL syntax conventions

Syntax

ACOS ( float_expression )  

Note

To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, 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. For values outside this range, no value is returned, and ACOS 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