Paul Koning wrote:
And also because most people believe that C applies normal computer arithmetic, and they believe that normal computer arithmetic is wrapped 2's complement. (And indeed it usually is, give or take some bizarre exceptions like MAX_INT % -1)
and not so bizarre exceptions like machines that trap on signed overflow.
We all know better, but how tiny is the fraction of C programmers who have ever even *seen* the ANSI C spec, much less know in detail what it says?
OK, but to me "knows C" (the predicate in my statement) certainly means being familiar with the standard, not necessarily by reading it, I am sure there are lots of good books on C that have a good account of the rules (K&R is clear enough on this particular issue).