How does a modulo operation work when the first number is smaller?

Does this help

22  % 5 = 2 
17  % 5 = 2 
12  % 5 = 2 
7   % 5 = 2 
2   % 5 = 2

Maybe this

22 / 5 = 4 + 2/5
17 / 5 = 3 + 2/5
12 / 5 = 2 + 2/5
7  / 5 = 1 + 2/5
2  / 5 = 0 + 2/5

5 goes into 2 zero times.

5*0 = 0

2-0 = 2.

The answer is 2.


2 divided by 5 (integer division) is 0 with a remainder of 2.


2 = 0 x 5 + 2