I had a doubt regarding the ‘mod’ operator So far I thought that modulus referred to the remainder, for example $8 \mod 6 = 2$ The same way, $6 \mod 8 = 6$, since $8\cdot 0=0$ and $6$ remains.
When I perform an operation such as 1) $-8 \mod 6 = 4$ And 2) $-6\mod 8 = 2$
I understood part 2) because on multiplying $8 \cdot (-1) =-8$, the remainder becomes $+2$ (I feel that multiplying by $(-1)$ is correct, because in theory $-8$ is a smaller number than $-6$).
However part 1) does not make any sense to me
Could somebody please give me an explanation regarding the above (part 1) Also do tell me if my way of thinking is wrong.
Thanks In advance.
$4$ is the unique number in $\{0,1,2,3,4,5\}$ such that it differs from $-8$ by a multiple of $6$, namely $-8=(-2)\cdot 6+4$.