適用於:SQL Server
Azure SQL 資料庫
Azure SQL 受控執行個體
Azure Synapse Analytics
分析平台系統(PDW)
Microsoft Fabric 中的 SQL 分析端點
Microsoft Fabric 中的倉儲
Microsoft Fabric 中的 SQL 資料庫
函數,傳回以弧度為單位的角度,其正弦值為指定的 float 運算式。 這也稱為反正弦函數 (Arcsine)。
語法
ASIN ( float_expression )
引數
float_expression
運算式,為 float 類型或是能隱含地轉換成 float 的類型。 只有範圍在 -1.00 到 1.00 之間的值為有效。 對於超出此範圍的值,不會傳回任何值,且 ASIN 會回報網域錯誤。
傳回類型
float
範例
此範例接受 float 運算式,並傳回指定角度的 ASIN 值。
/* The first value will be -1.01. This fails because the value is
outside the range.*/
DECLARE @angle FLOAT
SET @angle = -1.01
SELECT 'The ASIN of the angle is: ' + CONVERT(VARCHAR, ASIN(@angle))
GO
-- The next value is -1.00.
DECLARE @angle FLOAT
SET @angle = -1.00
SELECT 'The ASIN of the angle is: ' + CONVERT(VARCHAR, ASIN(@angle))
GO
-- The next value is 0.1472738.
DECLARE @angle FLOAT
SET @angle = 0.1472738
SELECT 'The ASIN of the angle is: ' + CONVERT(VARCHAR, ASIN(@angle))
GO
結果集如下所示。
-------------------------
.Net SqlClient Data Provider: Msg 3622, Level 16, State 1, Line 3
A domain error occurred.
---------------------------------
The ASIN of the angle is: -1.5708
(1 row(s) affected)
----------------------------------
The ASIN of the angle is: 0.147811
(1 row(s) affected)
範例:Azure Synapse Analytics 和 Analytics Platform System (PDW)
此範例傳回 1.00 的反正弦值。
SELECT ASIN(1.00) AS asinCalc;
此範例會傳回錯誤,因為它要求的反正弦值在允許的範圍之外。
SELECT ASIN(1.1472738) AS asinCalc;
請參閱
天花板(Transact-SQL)
數學函數 (Transact-SQL)
集合算術無視(Transact-SQL)
SET ARITHABORT (Transact-SQL)