W
William Payne
Hi, I was going through some old code of mine and spotted this:
if(i == 16 || i == 32 || i == 48 || i == 64 || i == 80 || i == 96 || i ==
112 || i == 128 ||
i == 144 || i == 160 || i == 176 || i == 192 || i == 208 || i == 224 || i
== 240)
i is of type int.
Now, isn't that if-statement equal to:
if(i >= 16 && i <= 240 && i % 16 == 0) ?
Seems to be equal, but I just wanted to hear someone say yes (or no). Which
variant do you prefer if they are equal?
// William Payne
if(i == 16 || i == 32 || i == 48 || i == 64 || i == 80 || i == 96 || i ==
112 || i == 128 ||
i == 144 || i == 160 || i == 176 || i == 192 || i == 208 || i == 224 || i
== 240)
i is of type int.
Now, isn't that if-statement equal to:
if(i >= 16 && i <= 240 && i % 16 == 0) ?
Seems to be equal, but I just wanted to hear someone say yes (or no). Which
variant do you prefer if they are equal?
// William Payne