Understanding the result of modulo operator: %%
Nothing wrong: The modulo is the number after +. In general, for two numbers a and b, there is Let’s write a toy function: Update: Instead of using floor(a / b) to get quotient, we can also use a %/% b.