Bartosz Dziewoski wrote in post #1090021:
> 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.

How can my intuition be wrong when you are not asking in what way I
require that arithmetic operation to perform?  You are showing your
intuition to be wrong.

"The math checks out"

How?  What is your basis for that statement?  In the general sense of
"math", an answer of "-1.8" would be that which checks out.  Ruby rounds
to negative infinity when one of two operands of an integer division
operation is negative, hence -9 / 5 = -2 ("The Ruby Programming
Language" book).  So, the correct statement is "The Ruby math checks
out"

ruby -le 'print (-9 / 5).to_i'
output:  -2

and I can add to it with "The Perl math checks out"

perl -le 'print int(-9 / 5)'
output:  -1