Watch out for these errors:
Confusing and . Division gives the quotient, modulo gives the remainder. Both are needed for different purposes.
Forgetting parentheses with mixed operations. is not the same as .
Ignoring negative numbers. Modulo behavior with negatives varies by language. Use for safety.
Not applying modulo in intermediate steps. Large multiplications overflow if you don't reduce before the next operation.