So, having big time meltdown about the math behind modulo calculations.

The examples state that 23 % 10 = 3. I get that, because 23 / 10 = 2,3 where the remainder is 3. No worries there. BUT further examples looks like this:

17 % 5 = 2

13 % 7 = 6

In my book 17 / 5 = 3,4 and the remainder should be 4, not 2.

And 13 / 7 = 1,857[...] and the remainder should be 8 (or maybe 9 if you round up) but not 6!

What am I doing wrong?