Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!rphroy!caen!uwm.edu!psuvax1!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Hexadecimal/octal constants Message-ID: <15530@smoke.brl.mil> Date: 20 Mar 91 21:51:05 GMT References: Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 In article rjohnson@shell.com (Roy Johnson) writes: >Is it true on every platform that 0xf == 15? Yes. >Is it also true on every platform that for bitwise operations, C >behaves as if it is on a two's complement machine, ... No. >... so that, e.g., the >result of 0xf & 0x2 is 0x2, even if the machine representation of >0xf is 1010 and 0x2 is 0101 [think hypothetical here 8^)]? The bitwise operations are carefully specified in the C standard to have the "right" properties. However, twos complement has nothing to do with this.