ASIN
Description
Returns the arc sine of x
, or NULL
if x
is not in the range -1
to 1
.
Syntax
ASIN(<x>)
Parameters
Parameter | Description |
---|---|
<x> | The value for which the arc sine is to be calculated |
Return Value
The arc sine value of parameter x
, expressed in radians.
Special Cases
- When
x
equals 0, returns 0 - When
x
equals 1, returns π/2 - When
x
equals -1, returns -π/2 - When
x
is not in the range [-1, 1], returnsNULL
- When
x
is NaN, returns NaN - When
x
is positive or negative infinity, returnsNULL
- When
x
is NULL, returns NULL
Examples
select asin(0.5);
+---------------------+
| asin(0.5) |
+---------------------+
| 0.52359877559829893 |
+---------------------+
select asin(0.0);
+------------+
| asin(0.0) |
+------------+
| 0 |
+------------+
select asin(1.0);
+--------------------+
| asin(1.0) |
+--------------------+
| 1.570796326794897 |
+--------------------+
select asin(-1.0);
+---------------------+
| asin(-1.0) |
+---------------------+
| -1.570796326794897 |
+---------------------+
select asin(2);
+------------+
| asin(2.0) |
+------------+
| NULL |
+------------+
select asin(cast('nan' as double));
+---------------------------+
| asin(cast('nan' AS DOUBLE)) |
+---------------------------+
| NaN |
+---------------------------+
select asin(cast('inf' as double));
+---------------------------+
| asin(cast('inf' AS DOUBLE)) |
+---------------------------+
| NULL |
+---------------------------+