Find a div m and a mod m when

6k Views Asked by At

Find a div m and a mod m when

$a = -111$, $m = 99$

I can't find the formula anywhere in my book.

1

There are 1 best solutions below

0
On BEST ANSWER

$a\bmod m$ is the unique number $b\in \{0,\ldots, m-1\}$ such that $a-b|m$.
$a\ \mathrm{div}\ m$ is the unique number $c$ such that $a-c\cdot m = a\bmod m$.

Your case gives rise to $a = -2\cdot 99 + 87$ so $a\bmod m = 87$ and $a\ \mathrm{div}\ m = -2$