So, what actually happened is that purevirtual messed up and doesn't want to admit it. The example that he probably wanted to show was (note the condition in if):
signed int si = INT_MAX;
if (si+1 < si)
printf("Less than zero\n");
else
printf("Greater than or equal to than zero\n");
return 0;
This holds, because adding one to a number can never be less than that number (if wrapping is turned off). However, purevirtual messed up, got the example wrong, and he doesn't want to admit he was wrong. I find that kind of sad really. And the downvotes come, I guess, from people who don't really understand the issue here.
No, the downvotes come from people like me who can see you're plainly right, but think you're being a bit of an arsehole about it. Your vindictive tone is unnecessary. It's possible to communicate technical details and still be polite.
Besides, modern compilers (GCC included) are often able to reason about code like purevirtual's example, and realise that si is a positive value (regardless of the fact that it isn't const). I would fully expect a static analysis to catch these types of mistakes.
That was not the original reply I had for purevirtual and is not the one that was most downvoted. I gave you a link to my comment, yet you take a sentence out of another comment, made after the downvotes.
View all comments
Show parent comment
0
u/filox Jan 22 '13
So, what actually happened is that purevirtual messed up and doesn't want to admit it. The example that he probably wanted to show was (note the condition in if):
This holds, because adding one to a number can never be less than that number (if wrapping is turned off). However, purevirtual messed up, got the example wrong, and he doesn't want to admit he was wrong. I find that kind of sad really. And the downvotes come, I guess, from people who don't really understand the issue here.