in the b=2 case, you get:
1 / 1 = 1 = b - 1
1 % 1 = 0 = b - 2
they are the other way around, see for example the b=3 case: 21 (base 3) = 7
12 (base 3) = 5
7 / 5 = 1 = b - 2
7 % 5 = 2 = b - 1