Home >Database >Mysql Tutorial >What are the mathematical functions of MySQL?
mysql mathematical functions include: 1. Absolute value function [ABS(X)] and function that returns pi [PI(X)]; 2. Square root function [SQRT(X)] and remainder function [MOD (X,Y)]; 3. Functions to obtain random numbers [RAN()] and [RAND(X)].
mysql mathematical functions include:
1, absolute value function ABS(X) and function PI that returns pi (X)
ABS(X) returns the absolute value of X
PI() returns the value of pi, which is displayed by default Bit
2, square root function SQRT(X) and remainder function MOD(X,Y)
SQRT(X) returns the second of a non-negative number x Square root
Find the remainder MOD(X,Y) returns the remainder of X/Y. MOD() also works for values with small parts. It returns is the exact remainder after the operation.
## 3. The function CEIL (X), CEILING (x), and Floor (x)
Ceil ( X) has the same meaning as CEILING(X). It returns the smallest integer value that is not less than X, and the return value is converted into a BIGINT
FLOOR(X) returns the largest integer value that is not greater than
##4. The functions RAN() and RAND(X) for obtaining random numbersRAND(X) returns a random Floating point number V, ranging from 0 to 1 5, functions ROUND(X), ROUND(X,Y) and TRUNCATE(X,Y)round(x) rounds the X value round(x,y) retains Y digits after the decimal point truncate(X,y) intercepts and retains the specified Y digits after the decimal point 6. Sign function SIGN(X)sign(X), when the value of x is a negative number, 0 or a positive number, the corresponding value is -1, 0, 1 ##7. Power operation functions POW(X,Y), POWER(X,Y) and EXP(X)POW(X,Y) and POWER(X,Y) are performed on the value of The power of Y
EXP(X) is to calculate the power of e
8. There is no need to explain the logarithmic functions LOG(X) and LOG10(X)
!9. Functions RADIANS(X) and DEGREES(X) that convert angles and radians to each other
RADIANS(X) converts X from angle to RadiansDEGREES(X) is to convert radians into angles
10, sine and arcsine functions SIN( X) and ASIN(X)
Directly above the picture11, cosine function COS(X) and inverse cosine function ACOS(X)
Go directly to the picture12. Tangent, arctangent, and cotangent functions
Go directly to the pictureRelated learning recommendations: mysql video tutorial
The above is the detailed content of What are the mathematical functions of MySQL?. For more information, please follow other related articles on the PHP Chinese website!