DEGREES(), DIV() and EXP() Function in MariaDB
1. DEGREES() Function :
In MariaDB, The DEGREES Function converts a radian value into degrees. In this function, a number will be passed as a parameter and it will return a degree of the radian value.
Syntax :
DEGREES(number)
Parameter : Required. A value in Radians.
number : Value in radians that is to be converted to degrees.
Returns : Degree equivalent of the value input in radians.
Example-1 :
SELECT DEGREES(-3.5);
Output :
-200.53522829578813
Example-2 :
SELECT DEGREES(PI()*3);
Output :
540
Example-3 :
SELECT DEGREES(1);
Output :
57.29577951308232
2. DIV() Function :
In MariaDB, The DIV Function used for integer division where n is divided by m and integer value is returned. In this function, two numbers will be passed as a parameter and it will return the result as an integer value. It can also be used with BIGINT values.
Syntax :
n DIV m
Parameters : Required. Two integer values.
- n : Divident (Value that will be divided).
- m : Divisor (Value which the dividend is being divided by).
Returns : An integer value as the result of the division.
Example-1 :
SELECT 11 DIV 4;
Output :
3
Example-2 :
SELECT 18 DIV 9;
Output :
2
Example-3 :
SELECT 18.4 DIV -2.5;
Output :
-7
3. EXP() Function :
In MariaDB, The EXP Function returns e raised to the power of number (or e^number). In this function, a number will be passed as a parameter and it will return e raised to the power of number. In this function e is the base of natural logarithms.
Syntax :
EXP(number)
Parameter : Required. A numeral value.
number : Power to raise e to, so the formula would be e^number.
Returns : e raised to the power of the input number.
Example-1 :
SELECT EXP(2);
Output :
7.38905609893065
Example-2 :
SELECT EXP(2.5);
Output :
12.182493960703473
Example-3 :
SELECT EXP(-2.5);
Output :
0.0820849986238988