ACOS (Transact-SQL)
這是一個數學函數,它會傳回其餘弦函數 (Cosine) 是指定 float 運算式的角度 (以弧度為單位);也稱為反餘弦函數 (Arccosine)。
適用於:SQL Server (SQL Server 2008 透過目前版本)、Windows Azure SQL 資料庫 (初始版本,透過目前版本)。 |
語法
ACOS ( float_expression )
引數
- float_expression
這是 float 類型或能夠隱含轉換成 float 之類型的運算式,值的範圍從 -1 到 1。 超出這個範圍的值會傳回 NULL 並且回報網域錯誤。
傳回類型
float
範例
下列範例會傳回指定之數字的 ACOS。
SET NOCOUNT OFF;
DECLARE @cos float;
SET @cos = -1.0;
SELECT 'The ACOS of the number is: ' + CONVERT(varchar, ACOS(@cos));
以下為結果集:
---------------------------------
The ACOS of the number is: 3.14159
(1 row(s) affected)