If memory serves me right, module is undefined on negative integers. int i = -2; i%=10; // i=undefined? What should I use instead to get i definitely equal to 7? On a sidenote, where can I read about operation order/definitions? Like i++, ++i and i%10 not changing i etc.