Works just like the mod function in mathematics.