Mathematical
You can find definitions for mathematical functions from abs to truncate.
Function | Description |
---|---|
abs | Returns the absolute value of X. |
acos | Returns the arc cosine of X, that is, the value whose cosine is X. Returns NULL if X is not in the range -1 to 1. |
asin | Returns the arc sine of X, that is, the value whose sine is X. Returns NULL if X is not in the range -1 to 1. |
atan | Returns the arc tangent of the two variables X and Y. It is similar to calculating the arc tangent of Y / X, except that the signs of both arguments are used to determine the quadrant of the result. |
ceil | Returns the smallest integer value not less than X. |
cos | Returns the cosine of X, where X is given in radians. |
cot | Returns the cotangent of X. |
crc32 | Computes a cyclic redundancy check value and returns a 32-bit unsigned value. The result is NULL if the argument is NULL. The argument is expected to be a string and (if possible) is treated as one if it is not. |
degrees | Returns the argument X, converted from radians to degrees. |
exp | Returns the value of e (the base of natural logarithms) raised to the power of X. |
floor | Returns the largest integer value not greater than X. |
ln | Returns the natural logarithm of X; that is, the base-e logarithm of X. |
log | If called with one parameter, this function returns the natural logarithm of X. If called with two parameters, this function returns the logarithm of X for an arbitrary base B. |
log2 | Returns the base-2 logarithm of X. |
log10 | Returns the base-10 logarithm of X. |
mod | Modulo operation. Returns the remainder of N divided by M. |
pi | Returns the value of ? (pi). The default number of decimal places displayed is seven, but MySQL uses the full double-precision value internally. |
pow | Returns the value of X raised to the power of Y. |
radians | Returns the argument X, converted from degrees to radians. (Note that ? radians equals 180 degrees.) |
rand | Returns a random floating-point value v between 0 and 1 inclusive (that is, in the range 0 <= v <= 1.0). If an integer argument N is specified, it is used as the seed value, which produces a repeatable sequence of column values. |
round | Returns the argument X, rounded to the nearest integer. With two arguments, returns X rounded to D decimal places. D can be negative to cause D digits left of the decimal point of the value X to become zero. |
sign | Returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive. |
sin | Returns the sine of X, where X is given in radians. |
sqrt | Returns the square root of a non-negative number X. |
tan | Returns the tangent of X, where X is given in radians. |
truncate | Returns the number X, truncated to D decimal places. If D is 0, the result has no decimal point or fractional part. D can be negative to cause D digits left of the decimal point of the value X to become zero |
Parent Topic: Functions