Mod: Difference between revisions

From The K Language Wiki
Content added Content deleted
("Add category")
("Add all appropriate categories to each verb")
Line 22: Line 22:


[[Category:Operator verbs]]
[[Category:Operator verbs]]
[[Category:Verbs]]
[[Category:Primitives]]

Revision as of 03:16, 9 July 2022

Mod
x!y

The mod, modulo, remainder or residue[1] function, denoted by !, is used for modulo in K.

Up until the K4 dialect, the modulo operator was left atomic on account of the rotate overload.

From K5 onward, the modulo primitive is right atomic.[2]

  3!12
0

  3!11
2

  5!15
0

  3!1 2 3 4 5 6 7 8 9 10 11 12
1 2 0 1 2 0 1 2 0 1 2 0

References