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
result = n % 3; if( result < 0 ) result += 3;
Don't perform extra mod operations as suggested in the other answers. They are very expensive and unnecessary.