Marco Correia wrote:

> hi,
> 
> Do you agree that 
> 
> -7 mod 12 == 5
> 
> ?
> 
> I'm asking because I know mod arithmetic can be tricky. Python says that this 
> is true, but gecode is failing on this constraint.
> 
> I'm not a gecode expert so probably I'm doing something wrong. I'm attaching 
> a 
> small test case.

There's two different definitions of division and modulo. Python uses one, and 
C/C++/Java etc use another. Gecode uses the C++ definition, where -7%12==-7.

Cheers,
        Guido

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/




_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to