4 ms·
But if it's unsigned this will never be true either... Conceptually, it works through promotion. -1 is cast to unsigned/size_t before the test, which then succ
by Lagged2Death 11y ago
But if it's unsigned this will never be true either...
Conceptually, it works through promotion. -1 is cast to unsigned/size_t before the test, which then succeeds. At the assembly level, a 32-bit -1 is 0xFFFFFFFF, which is also the result of the underflow of i, so it works at that level, too.
At any rate, it worked in the compiler I tried it with.