Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!rphroy!caen!uwm.edu!bionet!agate!ucbvax!ucsd!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Hexadecimal/octal constants Message-ID: <11206@dog.ee.lbl.gov> Date: 20 Mar 91 21:49:50 GMT References: Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Distribution: comp Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 21 X-Local-Date: Wed, 20 Mar 91 13:49:50 PST 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 ... Yes. This latter is guaranteed because both 15 and 2 are positive. Values of type (where T is any valid type) *are* `pure binary'; other integral values `act like' pure binary as long as they are nonnegative. -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov