Skip to content

Latest commit

 

History

History
60 lines (52 loc) · 7.4 KB

numeric-functions-and-operators.md

File metadata and controls

60 lines (52 loc) · 7.4 KB
title summary aliases
Numeric Functions and Operators
Learn about the numeric functions and operators.
/docs/dev/functions-and-operators/numeric-functions-and-operators/
/docs/dev/reference/sql/functions-and-operators/numeric-functions-and-operators/

Numeric Functions and Operators

TiDB supports all of the numeric functions and operators available in MySQL 8.0.

Arithmetic operators

Name Description
+ Addition operator
- Minus operator
* Multiplication operator
/ Division operator
DIV Integer division
%, MOD Modulo operator
- Change the sign of the argument

Mathematical functions

Name Description
ABS() Return the absolute value
ACOS() Return the arc cosine
ASIN() Return the arc sine
ATAN() Return the arc tangent
ATAN2(), ATAN() Return the arc tangent of the two arguments
CEIL() Return the smallest integer value not less than the argument
CEILING() Return the smallest integer value not less than the argument
CONV() Convert numbers between different number bases
COS() Return the cosine
COT() Return the cotangent
CRC32() Compute a cyclic redundancy check value
DEGREES() Convert radians to degrees
EXP() Raise to the power of
FLOOR() Return the largest integer value not greater than the argument
LN() Return the natural logarithm of the argument
LOG() Return the natural logarithm of the first argument
LOG10() Return the base-10 logarithm of the argument
LOG2() Return the base-2 logarithm of the argument
MOD() Return the remainder
PI() Return the value of pi
POW() Return the argument raised to the specified power
POWER() Return the argument raised to the specified power
RADIANS() Return argument converted to radians
RAND() Return a random floating-point value
ROUND() Round the argument
SIGN() Return the sign of the argument
SIN() Return the sine of the argument
SQRT() Return the square root of the argument
TAN() Return the tangent of the argument
TRUNCATE() Truncate to specified number of decimal places

Related system variables

div_precision_increment is used to set the precision for the / operator.