Euclidean division and negative numbers

256 Views Asked by At

I am trying to understand Euclidean division (https://en.wikipedia.org/wiki/Euclidean_division)

I am trying to do an example, and I am getting two different answers depending on where I have the negative sign:

9/(-4) = (-2)R1 [9 = (-4)*(-2) + 1]

(-9)/4 = (-3)R3 [-9 = 4*(-3) + 3]

How can this be? Where am I going wrong?

Thanks!