Skip to content

Mod

Returns the remainder when dividing the first argument by the second.

$ wo 'Mod[10, 3]'
1
$ wo 'Mod[7, 4]'
3
$ wo 'Mod[15, 5]'
0
$ wo 'Mod[8, 3]'
2
$ wo 'Mod[-1, 3]'
2
$ wo 'Mod[-5, 3]'
1
$ wo 'Mod[10, -3]'
-2
$ wo 'Mod[7.5, 2]'
1.5
$ wo 'Mod[0, 5]'
0

For Gaussian integers the remainder uses m - n*Round[m/n].

$ wo 'Mod[7 + 3 I, 2]'
-1 - I