for (i = 0; i < 5; i++) and for (i = 0; i - 5; i++) do the same thing in languages where 0 is false and all other values are true

for (i = 0; i < 5; i++) and for (i = 0; i - 5; i++) do the same thing in languages where 0 is false and all other values are true
for(int i = 0; i ^ 5; i++) is also like this isnt it. since !!(x^y) is the same as x != y
then is for (i = 5; i + 1; --i) the safest backwards loop for both signed and unsigned 🤔
Sounds like new guidelines material lets go (please lets not)
this is the kind of coding that gets your 101 teacher to ask you “if i give you extra credit for these array assignments will you stop solving them in the most mind bending way possible”
now you’re thinking like a CPU engineer. what is the CMP instruction but a SUB instruction that throws the result away
that is the point lol. only 0 is considered to be false in most languages, so:
i=0; i - 5 == -5; -5 == true // continue iterating
...
i=4; i - 5 == -1; -1 == true // continue iterating
i=5; i - 5 == 0; 0 == false // stop iterating