跳到主要内容
跳到主要内容

pmod

pmod

description

Syntax

BIGINT PMOD(BIGINT x, BIGINT y)
DOUBLE PMOD(DOUBLE x, DOUBLE y)

返回在模系下x mod y的最小正数解. 具体地来说, 返回 (x%y+y)%y.

example

MySQL [test]> SELECT PMOD(13,5);
+-------------+
| pmod(13, 5) |
+-------------+
| 3 |
+-------------+
MySQL [test]> SELECT PMOD(-13,5);
+-------------+
| pmod(-13, 5) |
+-------------+
| 2 |
+-------------+

keywords

PMOD