Skip to content

Latest commit

 

History

History
111 lines (86 loc) · 3.35 KB

File metadata and controls

111 lines (86 loc) · 3.35 KB
title ASIN (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 07/24/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
ASIN_TSQL
ASIN
dev_langs
TSQL
helpviewer_keywords
ASIN function
sine
arcsine
ms.assetid 6256dd7d-83d5-486e-a933-1d59afc7e417
caps.latest.revision 35
author BYHAM
ms.author rickbyh
manager jhubbard

ASIN (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-all_md]

Returns the angle, in radians, whose sine is the specified float expression. This is also called arcsine.

Topic link icon Transact-SQL Syntax Conventions

Syntax

-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse  
  
ASIN ( float_expression )  

Arguments

float_expression
Is an expression of the type float or of a type that can be implicitly converted to float, with a value from -1 through 1. Values outside this range return NULL and report a domain error.

Return types

float

Examples

The following example takes a float expression and returns the ASIN of the specified angle.

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

[!INCLUDEssResult]

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

Examples: [!INCLUDEssSDWfull] and [!INCLUDEssPDW]

The following example returns the arcsine of 1.00.

SELECT ASIN(1.00) AS asinCalc;  

The following example returns an error, because it requests the arcsine for a value outside the allowed range.

SELECT ASIN(1.1472738) AS asinCalc;  

See also

CEILING (Transact-SQL)
Mathematical Functions (Transact-SQL)
SET ARITHIGNORE (Transact-SQL)
SET ARITHABORT (Transact-SQL)