{ “title”: “SIN”, “language”: “en”, “description”: “Calculate the sine of the parameter” }

Description

Calculate the sine of the parameter

Syntax

SIN(<a>)

Parameters

ParameterDescription
<a>floating point number, the radian value of the parameter to calculate

Return Value

The sine of the parameter <a>, expressed in radians.

Special Cases

  • When a is NaN, returns NaN
  • When a is positive or negative infinity, returns NaN
  • When a is NULL, returns NULL

Examples

select sin(1);
+------------------------+
| sin(cast(1 as DOUBLE)) |
+------------------------+
|     0.8414709848078965 |
+------------------------+
select sin(0);
+------------------------+
| sin(cast(0 as DOUBLE)) |
+------------------------+
|                    0.0 |
+------------------------+
select sin(Pi());
+------------------------------------+
| sin(pi())                          |
+------------------------------------+
| 0.00000000000000012246467991473532 |
+------------------------------------+
select sin(cast('nan' as double));
+----------------------------+
| sin(cast('nan' AS DOUBLE)) |
+----------------------------+
| NaN                        |
+----------------------------+
select sin(cast('inf' as double));
+----------------------------+
| sin(cast('inf' AS DOUBLE)) |
+----------------------------+
| NaN                        |
+----------------------------+
select sin(cast('-inf' as double));
+-----------------------------+
| sin(cast('-inf' AS DOUBLE)) |
+-----------------------------+
| NaN                         |
+-----------------------------+