# Reference/mod

From Kx Wiki

Revision as of 11:33, 20 August 2014 by Charlie Skelton (Talk | contribs)

## mod (modulus verb)

`x mod y` returns the remainder of `x%y`. Applies to numeric types, and gives type error on sym, char and temporal types.

## Syntax

q)r:X mod Y

## Example

q)-3 -2 -1 0 1 2 3 4 mod 3 0 1 2 0 1 2 0 1

For a complete list of functions, see the kdb+ Function Reference.