I know how $\div$ and $\mathrm{mod}$ works but I have come across the following example and I do not understand it:
$-117 \pmod {352} = 235$
Shouldn't that be equal to $-117$?
I know how $\div$ and $\mathrm{mod}$ works but I have come across the following example and I do not understand it:
$-117 \pmod {352} = 235$
Shouldn't that be equal to $-117$?
Note that $-117 = (-1)352 + 235 \in 235 + 352\mathbb{Z}$, which shows that $-117\equiv235 \mod 352$.
From $0 \equiv 352 \pmod{352}$ it follows that $$ -117 = 0 - 117 \equiv 352 - 117 = 235 \pmod{352}. $$