News for hackers. Stuff that matters.
Re:Beating the compiler by billpg on Monday March 23, 2015 @07:02AM (#9250271)
"Our problem will be a very simple one: sum a list of n integers. To make this fair, we will assume that the integers all fit in a 32-bit signed int, and that their sum fits in a 32-bit signed int."

What if my list is: [2000000000, 2000000000, -2000000000, -2000000000]

Re:Beating the compiler by ajuc on Monday March 23, 2015 @08:05AM (#9250436)
It will wrap around both ways and correctly return 0. At least it does on my compiler, I never remember what is part of standard C and what is accident of implementation.

But it won't work for {2000000000, 2000000000}, as stated in the article.