ASIN (Transact-SQL)
適用於:Microsoft Fabric 中 Microsoft Fabric倉儲中的 SQL ServerAzure SQL 資料庫 Azure SQL 受控執行個體 Azure SynapseAnalytics Analytics Platform System (PDW)SQL 分析端點
函數,傳回以弧度為單位的角度,其正弦值為指定的 float 運算式。 這也稱為反正弦函數 (Arcsine)。
Syntax
ASIN ( float_expression )
注意
若要檢視 SQL Server 2014 (12.x) 和舊版的 Transact-SQL 語法,請參閱 舊版檔。
引數
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;
請參閱
CEILING (Transact-SQL)
數學函數 (Transact-SQL)
SET ARITHIGNORE (Transact-SQL)
SET ARITHABORT (Transact-SQL)
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應