MySQL ACOS() function
ACOS() function
MySQL ACOS() returns the arc cosine of a number. The function returns NULL when the value of the number is not between the range -1 to 1.
Syntax:
ACOS(N)
Argument:
Name | Description |
---|---|
N | A number whose arc cosine value is to be retrieved. |
Syntax Diagram:

MySQL Version: 5.6
Example:
Code:
SELECT ACOS(1);
Explanation:
The above MySQL statement will return the cosine value of the number defined as an argument.
Sample Output:
mysql> SELECT ACOS(1); +---------+ | ACOS(1) | +---------+ | 0 | +---------+ 1 row in set (0.02 sec)
Example : ACOS() function using fractional number
Code:
SELECT ACOS(1.001);
Explanation:
The above MySQL statement will return NULL because the value defined in the argument is greater than the range.
Sample Output:
mysql> SELECT ACOS(1.001); +-------------+ | ACOS(1.001) | +-------------+ | NULL | +-------------+ 1 row in set (0.00 sec)
Example: ACOS() function using zero(0)
Code:
SELECT ACOS(0);
Explanation:
The above MySQL statement will return the cosine value of the number defined as an argument.
Sample Output:
mysql> SELECT ACOS(0); +-----------------+ | ACOS(0) | +-----------------+ | 1.5707963267949 | +-----------------+ 1 row in set (0.00 sec)
All Mathematical Functions
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook