So I thought that negative numbers, when mod\'ed should be put into positive space... I cant get this to happen in objective-c
I expect this:
-1 % 3
If this will be the behavior, and you know that it will be, then for m % n = r, just use r = n + r. If you're unsure of what will happen here, use then r = r % n.
m % n = r
r = n + r
r = r % n
Edit: To sum up, use r = ( n + ( m % n ) ) % n
r = ( n + ( m % n ) ) % n