MySQL: ACOS Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL ACOS Function

In this guide, we will explain how to use the MySQL ACOS function with syntax and examples.

Description

The MySQL ACOS function returns the arc cosine of a number.

Syntax

The syntax for the ACOS function is:

ACOS( number )

Parameters or Arguments

number

The number used to calculate the arc cosine.

Note

  • The ACOS function will return NULL, if number is not within the range of -1 to 1.

Applies To

The ACOS function can be used in the following versions :

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let’s look at some ACOS function examples and explore how to use the ACOS function.

For example:

mysql> SELECT ACOS(0.75);
Result: 0.7227342478134157

mysql> SELECT ACOS(0.2);
Result: 1.369438406004566

mysql> SELECT ACOS(-0.9);
Result: 2.6905658417935308

mysql> SELECT ACOS(2);
Result: NULL

Next Topic : Click Here

This Post Has One Comment

Leave a Reply