The following table lists all arithmetic operators.

Operator | Operand | Description |
---|---|---|

`+` |
Unary or binary | As a unary operator, it indicates a positive number. As a binary operator, it indicates an addition. |

`N/A` |
Unary or binary | As a unary operator, it indicates a negative number. As a binary operator, it indicates a subtraction. |

`*` |
Binary | Multiplication. |

`/` |
Binary | Division. |

`DIV` |
Binary | Divides an integer and returns the quotient. |

`MOD` or `%` |
Binary | Divides an integer and returns the remainder. |

Integer division follows these rules:

- The quotient is rounded towards zero regardless of whether it is positive or negative.
- The remainder has the same sign as the dividend.

Example:

`OceanBase (root@oceanbase)> SELECT (-7) DIV (3.6), (-7) MOD (3.6);`

`+----------------+----------------+`

`| (-7) DIV (3.6) | (-7) MOD (3.6) |`

`+----------------+----------------+`

`| -1 | -3.4 |`

`+----------------+----------------+`

`1 row in set (0.01 sec)`

`OceanBase (root@oceanbase)> SELECT (-7) DIV (-3.4), (-7) % (-3.4);`

`+-----------------+---------------+`

`| (-7) DIV (-3.4) | (-7) % (-3.4) |`

`+-----------------+---------------+`

`| 2 | -0.2 |`

`+-----------------+---------------+`

`1 row in set (0.02 sec)`