pmod

description

Syntax

BIGINT PMOD(BIGINT x, BIGINT y) DOUBLE PMOD(DOUBLE x, DOUBLE y) Returns the positive result of x mod y in the residue systems. Formally, return (x%y+y)%y.

example

  1. MySQL [test]> SELECT PMOD(13,5);
  2. +-------------+
  3. | pmod(13, 5) |
  4. +-------------+
  5. | 3 |
  6. +-------------+
  7. MySQL [test]> SELECT PMOD(-13,5);
  8. +-------------+
  9. | pmod(-13, 5) |
  10. +-------------+
  11. | 2 |
  12. +-------------+

keyword

  1. PMOD