signed integer overflow is undefined, this explains the required change in divs as some compilers will use this to optimize