docs.intersystems.com
Home  /  Application Development: Core Topics  /  InterSystems SQL Reference  /  SQL Functions  /  ASIN


InterSystems SQL Reference
ASIN
[Back]  [Next] 
InterSystems: The power behind what matters   
Search:  


A scalar numeric function that returns the arc-sine, in radians, of the sine of an angle.
Synopsis
{fn ASIN(numeric-expression)}
Arguments
numeric-expression A numeric expression whose value is between -1 and 1. This is the sine of the angle.
ASIN returns either the NUMERIC or DOUBLE data type. If numeric-expression is data type DOUBLE, ASIN returns DOUBLE; otherwise, it returns NUMERIC.
Description
ASIN returns the inverse (arc) of the sine of an angle as a floating point number. The value of numeric-expression must be a signed decimal number ranging from 1 to -1 (inclusive). A number outside of this range causes a runtime error, generating an SQLCODE -400 (fatal error occurred). ASIN returns NULL if passed a NULL value. ASIN treats nonnumeric strings, including the empty string (''), as the numeric value 0.
ASIN returns a value with a precision of 19 and a scale of 18.
ASIN can only be used as an ODBC scalar function (with the curly brace syntax).
You can use the DEGREES function to convert radians to degrees. You can use the RADIANS function to convert degrees to radians.
Examples
The following examples show the effect of ASIN on two sines.
SELECT {fn ASIN(0.52)} AS ArcSine 
returns 0.5468509506...
SELECT {fn ASIN(-1.00)} AS ArcSine 
returns -1.5707963267...
See Also