it appears that "i" is being cast to an unsigned int which would make it a very large number (the int max)
the way the computer handles negatives is that the number is INTMAX - value ..if that is converted to a unsigned the negative number is suddenly positive .. more technically the highest bit is called the sign bit..it's 1 for negative numbers and 0 for positive..when you relate that to pure counting it means the upper half of the range of an int is considered negative when it's a signed int