On Tue, Apr 1, 2008 at 2:40 PM, Ed Murphy <[EMAIL PROTECTED]> wrote:

> Geoffrey Spear wrote:
> > On Tue, Apr 1, 2008 at 12:27 PM, Ian Kelly <[EMAIL PROTECTED]>
> wrote:
> >> On Tue, Apr 1, 2008 at 9:49 AM, Iammars <[EMAIL PROTECTED]> wrote:
> >>  > Wow. That was probably the worst land for me to get. I had 2 Digit
> Ranches
> >>  > (4) and a subtraction Mill. 0 is the only number I can make!
> >>
> >>  It would take two weeks, but you could make a 0 and then subtract 4
> >>  from it to get 6.
> >
> > There seems to be some disagreement in the literature (and apparently
> > in C machine-dependent differing behavior of the % operator) about how
> > to take the modulus of a negative number.  There seem to be equally
> > good arguments that ((0-4) % 10) = 6 or 4.
>
> I could see +6 or -4, but +4?  Or did you just mean the Mill output?
>

Talking about the Mill output. And I tend to agree with the answer of 6,
mainly because you should be able to write out any modulus equation of a mod
b = c as:
b * x + c = a
Where a, b, c, and x are integers, and b and c are positive. This would
give:
10 * -1 + 6 = -4
representing
-4 mod 10 = 6
-- 
-----Iammars
www.jmcteague.com

Reply via email to