Why is it that $a\equiv b \pmod m \iff m\mid(a-b)$? I know this is a definition, but it's a definition I don't understand. I know that if $m\mid(a-b)$ then there exists some $q\in\mathbb Z$ such that $mq=a-b$.
But when I take $a\equiv b \bmod m$ I obtain $b=mq+a$, solving for $mq$ I get $mq=b-a$ instead of $mq=a-b$.
Am I getting something wrong about what $a\equiv b\pmod m$ means? My understanding says $b$ is a dividend, $m$ is a divisor, and $a$ is a remainder. The devision algorithm says dividend${}=(\text{divisor}\times\text{quotient})+\text{remainder},$ so that's how I get $b=mq+a$.