mod

description

Syntax

mod(col_a, col_b)

column support type:TINYINT SMALLINT INT BIGINT LARGEINT FLOAT DOUBLE DECIMAL

Find the remainder of a/b. For floating-point types, use the fmod function.

example

  1. mysql> select mod(10, 3);
  2. +------------+
  3. | mod(10, 3) |
  4. +------------+
  5. | 1 |
  6. +------------+
  7. mysql> select fmod(10.1, 3.2);
  8. +-----------------+
  9. | fmod(10.1, 3.2) |
  10. +-----------------+
  11. | 0.50000024 |
  12. +-----------------+

keywords

  1. MODFMOD