In SQLite, the tan() function calculates the tangent of a value in radians.
Syntax #
tan(x)
Arguments #
x
x is a number, an expression, or a table column that you want to calculate the tangent. x is in radians.
Return Type #
real
The function returns the tangent of x in radians. If x is NULL, the function returns NULL.
If x is a string, the tan() function will convert the value into a number before calculating the tangent. If the conversion fails, the tan() function returns NULL.
Examples #
The following example uses the tan() function to calculate the tangent of zero (0):
SELECT tan(0) result;
Output:
result
------
0.0
The following statement uses the tan() function to return the tangent of pi/4:
SELECT round(tan(pi()/4)) result;
Output:
result
------
1.0
Thank you for your feedback!