SQLite MOD() Function
Definition and Usage
The MOD() function returns the remainder when one number is divided by another.
It also works with decimal numbers. The % operator turns the numbers into integers first, so 10.5 % 3 gives 1.0, but MOD(10.5, 3) gives 1.5.
Note: Some SQLite builds do not include the math functions, because they need the compile option SQLITE_ENABLE_MATH_FUNCTIONS. They work in our editor.
Syntax
MOD(x, y)
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. The number to divide |
| y | Required. The number to divide by. If it is 0, NULL is returned |
Technical Details
| Return type: | Real |
|---|---|
| Works in: | SQLite 3.35.0 and later |