TAN(X) returns the tangent of X, where X is in radians. Near angles where cosine approaches zero, floating-point results can become extremely large rather than representing mathematical infinity exactly.
SELECT ROUND(TAN(PI()), 2); -- Output: -0.00 (floating-point approximation)
SELECT TAN(PI() / 2); -- Very large finite floating-point value
SELECT ROUND(TAN(PI() / 3), 2); -- Output: 1.73
SELECT TAN(X);
RADIANS() converts degrees to radians.
SELECT TAN(RADIANS(0)); -- Output: 0
SELECT TAN(RADIANS(45)); -- Output: 1
SELECT TAN(RADIANS(90)); -- Very large finite floating-point value
SELECT ROUND(TAN(RADIANS(180)), 2); -- Output: -0.00
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.