Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please could any one explain me why ?
mod( -4,3 ) returns 2
Thanks.
It's in detail explained here:
Euclidean division - Wikipedia, the free encyclopedia
In your example, the quotient would be -2 and the remainder 2:
-2*3 +2 = -4
Mod() aka "remainder" is always positive by definition
Given two integers a and b, with b ≠ 0, there exist unique integers q and r such that
and