mysql common math functions

The function fails and returns null
BIN(X) function : Returns the binary length of X
(x) The length of the space occupied by the returned number
ABS(X) : Absolute value function
PI() : The value of π
SQRT(X): The square root function x<0 return null
MOD (a,b): The remainder function a%b can return a decimal
CEIL(x) : The rounding function rounds
up CEILING(X): The rounding function rounds up
LOOR(X) : Rounds down
Get a random number: RAND() 0~1       RAND
   (X) X is the same in the same instruction, return is the same,
   rounding function 
) => 200 270 (y=-2) => 300
      TRUNCATE(x,y) No rounding when reserved
Sign function function SIGN(X) : return positive (1), negative (-1), 0
power operation function POW( x,y) reurn x^y
   POWER(x,y) return x^y
   EXP(x,y) return e^y
logarithmic function LOG(x) natural logarithm
   LOG10(x) return log10x
angle function Angle——》 radiansRADIANS(x)
   Radians-->Angle DEGREES(x)
sine function SIN(x) x is radians
arcsine function ASIN(x) -1<x<1 else return null
cosine function COS(x)
arc cosine function ACOS(x)
tangent function TAN (x)
Arctangent function ATAN(x)
Cotangent function CRAN(x)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325448830&siteId=291194637
Recommended