ASIN
ASIN is a Mathematical Function in SQL (Structured Query Language). It returns the arcsine, or the inverse sine, of a number.]
DOUBLE ASIN(DOUBLE X);
- x: This parameter represents a floating-point value within the range of -1 to 1 inclusive. It’s the value whose arc sine is to be returned.
Example
Output
Explanation
In this example, the ASIN()
function is used in MySQL to return the arc sine of the number 1. The output, 1.5707963267949
, is the radian equivalent of 90 degrees.
ASIN(double precision) —> double precision
- name: double precision
Example
In SQL, the ASIN
function can be used to compute the arcsine of a number. The following is an example using PostgreSQL:
Output
The output from the above code will be:
Explanation
In the example provided, the ASIN
function returns the arcsine of 0.5. The result is in radians, and in this specific case, the arcsine of 0.5 is approximately 0.5235987755983.
ASIN( float_expression )
- float_expression: The parameter `float_expression` is a floating point number in the range of -1 to 1. It represents the value for which the arc sine needs to be calculated. This is an expression of type float or of a type that can be implicitly converted to float.
Example
Output
Explanation
The example demonstrates the ASIN function in SQL Server. The ASIN
function returns the arcsine, or inverse sine of a number which is between -1 and 1. In this case, the argument for the ASIN
function is 0.5. The result is in radians and is approximately 0.52 radians.
ASIN(n NUMBER) RETURN NUMBER;
- n number: This is the numerical argument passed to the ASIN function. It should be a value within the range of -1 and 1. The function will return an error if the value lies outside of this range. The ASIN function returns the arc sine of ‘n’. The result is in radians and is between -π/2 and π/2.
Example
Output
Explanation
The ASIN function in this example returns the arc sine of 0, which is 0. The ASIN function in Oracle SQL takes a number as argument and returns the arc sine of the number. The returned value is in the range from -π/2 to π/2. The DUAL table is a built-in table in Oracle SQL for functions that return exactly one row.