home bbs files messages ]

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,898 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All   
   Re: "Portability" of operators working o   
   10 Feb 12 14:13:58   
   
   6f7a45bb   
   From: daniel.kruegler@googlemail.com   
      
   On 2012-02-10 11:09, Camilo Bravo Valdés wrote:   
   > Do operators like&, | and ^ "assume" an internal representation of   
   > the integers they work on? I mean, on a (hypothetical?) computer that   
   > does not represent numbers in base 2, will they "work" properly, or is   
   > there an abstraction layer between the inner representation and what a   
   > C++'s compiler "understands"?   
      
   You need to define what "work properly" is supposed to mean, no kidding   
   intended, but without such an information you cannot expect reasonable   
   replies. All of these operators are defined for integer types, but they   
   might be under-specified depending on the details of your questions. A   
   machine that supports C++ must somehow emulate either of   
   twos-complement, ones-complement, or sign-magnitude representation for a   
   base two for integer types. Floating-point types can have different   
   bases than two.   
      
   HTH & Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
         [ 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