Re: [math-fun] Unusual ways to count thru all w-bit numbers
Warren D Smith wrote:
To DW: Thank you for proving C++ sucks beyond belief and it NOT, contrary to propaganda, a superset of plain C. And, as a followup question, can C++ tell you whether there was an overflow?
Don't believe everything you read about C++ in this mailing list. The C++ committee is not made out of idiots. Unlike signed integers for which overflow is undefined behavior, unsigned integers always behave modulo 2^w. Leo
Leo, I'm sure many of us appreciated your quiet reply about C++. Best regards Neil Neil J. A. Sloane, President, OEIS Foundation. 11 South Adelaide Avenue, Highland Park, NJ 08904, USA. Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ. Phone: 732 828 6098; home page: http://NeilSloane.com Email: njasloane@gmail.com On Wed, Apr 8, 2015 at 2:04 AM, Leo Broukhis <leob@mailcom.com> wrote:
Warren D Smith wrote:
To DW: Thank you for proving C++ sucks beyond belief and it NOT, contrary to propaganda, a superset of plain C. And, as a followup question, can C++ tell you whether there was an
overflow?
Don't believe everything you read about C++ in this mailing list. The C++ committee is not made out of idiots. Unlike signed integers for which overflow is undefined behavior, unsigned integers always behave modulo 2^w.
Leo
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
* Leo Broukhis <leob@mailcom.com> [Apr 08. 2015 12:06]:
[...]
Don't believe everything you read about C++ in this mailing list. The C++ committee is not made out of idiots. Unlike signed integers for which overflow is undefined behavior, unsigned integers always behave modulo 2^w.
Don't essentially all existing platforms(*) just treat signed "int"s as what they are: fixed length registers? I know only of Itanium where overflow may trap (not even sure if it's the default there, at least I got no warnings and no traps the single time I used Itanium). (*) CPU + O/S + compiler Best regards, jj
Leo
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (3)
-
Joerg Arndt -
Leo Broukhis -
Neil Sloane