ASIN (Transact-SQL)

Restituisce l'angolo, espresso in radianti, il cui seno corrisponde all'espressione float specificata. Il valore restituito viene definito anche arcoseno.

Icona di collegamento a un argomentoConvenzioni della sintassi Transact-SQL

Sintassi

ASIN ( float_expression )

Argomenti

  • float_expression
    Espressione di tipo float o di un tipo che può essere convertito in modo implicito in tipo float, con un valore compreso tra -1 e 1. I valori non inclusi in questo intervallo restituiscono NULL e segnalano un errore di dominio.

Tipi restituiti

float

Esempi

Nell'esempio seguente viene valutata un'espressione float che restituisce l'arcoseno dell'angolo specificato.

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

Set di risultati:

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