On Sun, 23 Dec 2012 19:24:00 +0100, Derrick B. <lists / ruby-forum.com> wrote:

> But I want a "correct" answer, which is not -2.  Hence:

Why? -9 / 5 = -2 with a remainder of 1, because -2 * 5 + 1 = -9.

The math checks out, it's your intuition that's wrong. If you want the numbers to behave as if they were positive, use their absolute value and then adjust the sign.

-- 
Matma Rex