float a = 0; while (true) { a++; if (a > 16777216) break; // Will never break... a stops at 16777216 }
Can anyone explain this t
16777217 cannot be represented exactly with a float. The next highest number that a float can represent exactly is 16777218.
So, you try to increment the float value 16777216 to 16777217, which cannot be represented in a float.