Rem function

Refer to the Mod function.