SELECT COT(PI()); // Output is -8.16561967659769e+015 or Infinity
SELECT ROUND(COT(PI()/2),2); // Output is 0.00
SELECT ROUND(COT(PI()/3),2); // Output is 0.58
We used ROUND() to show only two decimal places. SELECT COT( X )
X is in Radian Radians function convert degree value to radian.
SELECT COT(RADIANS(0)); // Output is NULL SELECT COT(RADIANS(45)); // Output is 1 SELECT ROUND(COT(RADIANS(90)),2); // Output is0.00 SELECT ROUND(COT(RADIANS(180)),2); // Output is InfinitySQL Math References TAN() sin()
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.