Don't tell me the whole answer...I just need a hint, I guess.
I'm supposed to prove that a div b is non-negative when a and b have the same sign, and non-positive when they have different signs.
Am I on the right track with this (this is just the first case I'm supposed to consider)?
Case 1. Assume a ≥ 0 and b < 0. rb ≥ 0, so r ≤ 0.
Then a div b = q = (a - r) / b
Since r ≤ 0 and a ≥ 0, a div b can be rewritten as ( |a|+ |r| ) / b
Since b < 0, a div b can be rewritten as (-1)( |a|+ |r| ) / |b|
Since ( |a|+ |r| ) / |b| is non-negative, the value a div b is non-positive in this case.