Loading

MySQL Numeric or Mathematical Function Part1

In MySQL Numeric or Mathematical Function Part 1, we will discuss the ABS Function, ACOS Function, ASIN Function, ATAN Function, and ATAN2 Function.

ABS Function:- The ABS Function is used for returning an absolute positive value.

Syntax:- ABS(NUMBER)

For Example:-

SELECT ABS(47.5);

output:- 47.5

SELECT ABS(-47.5);

output:- 47.5

ACOS Function:- ACOS Function is used for returning arc cosine numbers. The number range should be between -1 and 1. Otherwise, it returns NULL.

Syntax:- ACOS(number)

For Example:-

SELECT ACOS(0.3);

Output:-1.2661036727794992

SELECT ACOS(0);

Output:- 1.5707963267948966

SELECT ACOS(1);

Output:- 0

SELECT ACOS(-1);

Output:-3.141592653589793

SELECT ACOS(3.24);

Output:- NULL

ASIN Function:- ASIN Function is used for returning arc sine number. The number range should be between -1 and 1. Otherwise, it returns NULL.

Syntax:- ASIN(number)

For Example:-

SELECT ASIN(0.3);

Output:- 0.3046926540153975

SELECT ASIN(0);

Output:- 0

SELECT ASIN(1);

Output:- 1.5707963267948966

SELECT ASIN(-1);

Output:- -1.5707963267948966

SELECT ASIN(3.24);

Output:- NULL

ATAN Function:- ATAN Function is used for returning the arc tangent of any given one or two numbers.

Syntax:-

ATAN(number)

ATAN(number1, number2)

For Example:-

SELECT ATAN(4.7);

Output:- 1.3611564809206842

SELECT ATAN(0);

Output:- 0

SELECT ATAN(1);

Output:- 0.7853981633974483

SELECT ATAN(2.7, 2);

Output:- 0.9332475286562039

SELECT ATAN(-1);

Output:- -0.7853981633974483

ATAN2 Function:- ATAN2 Function is used for return arc tangent of given two numbers.

Syntax:- ATAN(number1, number2)

For Example:-

SELECT ATAN(2.7, 2);

Output:- 0.9332475286562039

Read Also:-

MySQL Numeric or Mathematical Function Part2
MySQL Numeric or Mathematical Function Part3
MySQL Numeric or Mathematical Function Part4
MySQL Numeric or Mathematical Function Part5

Read more detail about MySQL Numeric or Mathematical Function manual

Share with:


Leave a Reply

Connect with:

z35W7z4v9z8w
Verified by ExactMetrics