ASIN (języka Transact-SQL)

Zwraca to kąt w radianach, którego sinus równy jest określony float wyrażenie. Jest to również arcus sinus.

Topic link iconKonwencje składni języka Transact-SQL

ASIN ( float_expression )

Argumenty

  • float_expression
    Is wyrażenie typufloat lub określonego typu, można niejawnie przekonwertować LANE o wartości od -1 do 1. Wartości poza tym zakresem zwrócenie wartości NULL i raport błędu domena.

Zwracane typy

float

Przykłady

W poniższym przykładzie ma float wyrażenie i zwraca ASIN podanego kąta.

/* 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

Here is the result set.

-------------------------
.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)