From: "Campbell, Rolf [SKY:1U32:EXCH]" Newsgroups: comp.os.msdos.djgpp Subject: Re: odd or even? Date: Mon, 06 Mar 2000 09:48:33 -0500 Organization: Nortel Networks Lines: 26 Message-ID: <38C3C541.2E113E7D@americasm01.nt.com> References: <38BE28A9 DOT CD476C62 AT student DOT kuleuven DOT ac DOT be> <38BE4B85 DOT 1F5A0778 AT videotron DOT ca> <38BE7E6D DOT 6FE78AC9 AT americasm01 DOT nt DOT com> <89to3c$1th$1 AT antares DOT lu DOT erisoft DOT se> NNTP-Posting-Host: wmerh0tk.ca.nortel.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.72 [en] (X11; I; HP-UX B.10.20 9000/785) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Martin Stromberg wrote: > : >It should work fine with signed integers.... > : >-1 = 0xFFFFFFFF (lowest bit set) > : >-2 = 0xFFFFFFFE (lowest bit not set) > > : Might not work on other machines, though. (I honestly don't know, > : I've never used a machine that wasn't 2's-complement) > > One's complement works as well: > +0 = 0x00000000 (lowest bit not set) > -0 = 0x80000000 (lowest bit not set) > -1 = 0x80000001 (lowest bit set) > -2 = 0x80000002 (lowest bit not set) > > What other interesting representations are there? Well, I've heard of a format where you only had to flip 1 bit to increment or decrement any integer.. But I don't know if anyone actually make a processor for it. -- (\/) Rolf Campbell (\/)