Files
doris/docs/en/sql-manual/sql-functions/math-functions/pmod.md

1.3 KiB

title, language
title language
pmod en

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

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

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

keywords

PMOD