Le 25/09/2013 01:23, Jesus a écrit :
> I've been racking my brain with a simple problem and I've discovered
> something weird with "Mod" operator, returning wrong results.
>
> For example, -3 Mod 800 gives -3, and it should be 797.
>
> It's only me or someone else has wrong results?
>

See
http://en.wikipedia.org/wiki/Modulo_operation#Common_pitfalls

-3 Mod 800 = -(3 Mod 800)

This is not the mathematical modulus operator.

-- 
Benoît Minisini

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to