News for hackers. Stuff that matters.
Re:Subtraction is not comparison by Sharlin on Friday December 26, 2014 @11:25AM (#8799194)
In mainstream compilers, even on x64, sizeof(long) == sizeof(int). You need long long instead. Of course, in the general case there's exactly zero guarantee that there even exists an integral type wider than int.
Re:Subtraction is not comparison by TwoBit on Friday December 26, 2014 @12:10PM (#8799356)
The C99 language standard requires support for long long.
Re:Subtraction is not comparison by dezgeg on Friday December 26, 2014 @10:53PM (#8801625)
But an implementation where sizeof(int) == sizeof(long) == sizeof(long long) is allowed by the specification.
Re:Subtraction is not comparison by marvy on Wednesday December 31, 2014 @03:56AM (#8818655)
On a (slightly) more practical level: there exists some largest integer type. You may someday need to sort it. If you want your sort to always work, you can't afford to overflow.