Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 31,919 of 33,346    |
|    stan to All    |
|    Re: "Portability" of operators working o    |
|    13 Feb 12 10:35:51    |
      777060e0       From: smoore@exis.net              SG wrote:       > On Feb 12, 12:20 am, Seungbeom Kim wrote:       >> On 2012-02-10 14:14, Francis Glassborow wrote:       >>       >> > How an actual system represents values is irrelevant, the C++ Standard       >> > requires that an implementation conforms to the abstract machine. In       C++       >> > this abstract machine is required to represent integer types in a pure       >> > binary form (there are three options, two's complement (most common)       >> > ones complement (I think this is very rare these days), sign and       >> > magnitude (again rare). There are no other options. The bitwise       >> > operators will operate on the 'bits' even if the underlying system uses       >> > some other representation.              Basically bit operators don't operate on numbers, the operands are       bits. If you need to operate on numbers stick to numerical       operators. If you want to mix the two the burden is on the perpetrator       and the result is not portable.                     --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca