Home >Database >Mysql Tutorial >A brief summary of MySQL math functions

A brief summary of MySQL math functions

藏色散人
藏色散人Original
2019-03-30 10:26:123355browse

MySQL contains many functions and operators that can help us process data. Below we will sort out the mathematical functions available in MySQL. We hope it will be helpful to friends in need!

ABS()Returns the absolute value of the given value.

ACOS()Returns the arc cosine of a number.

ASIN()Returns the arcsine of a number.

ATAN()Returns the arctangent of one or more values.

ATAN2()Returns the arc tangent of the two parameters.

CEIL() is synonymous with CEILING().

CEILING()Rounds a number to the nearest integer (returns the smallest integer that is not less than its argument).

CONV()Convert numbers between different number bases.

COS()Returns the cosine value of the number.

COT()Returns the cotangent of the number.

CRC32()Calculate the cyclic redundancy check value.

DEGREES()Convert from radians to degrees.

EXP()Returns e to the power of x.

FLOOR()Rounds a number down to the nearest integer (returns the largest integer value not larger than the argument).

LN()Returns the natural logarithm of a number.

LOG()Returns the natural logarithm of a number. Also allows you to specify the base.

LOG10()Returns the base 10 logarithm of the parameter.

LOG2()Returns the base 2 logarithm of the parameter.

MOD()Performs modular operation. Returns the remainder of N divided by M.

PI()Returns the value of π (pi).

POW() Returns the raised argument to the specified power.

POWER()Synonym POW().

RADIANS()Converts a value from degrees to radians and returns the result.

RAND()Returns a random floating point value.

ROUND()Rounds a number up or down to a given number of decimal places.

SIGN()Returns the sign of the argument (so you know whether the number is positive or negative).

SIN()Returns the sine value of the parameter.

SQRT()Returns the square root of the parameter.

TAN()Returns the tangent value of the parameter.

TRUNCATE()Truncate the value to the specified number of decimal places.

Related recommendations: "mysql tutorial"

The above is the detailed content of A brief summary of MySQL math functions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn