delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/05/10:06:20

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: odd or even?
Date: 5 Mar 2000 13:39:56 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 26
Message-ID: <89to3c$1th$1@antares.lu.erisoft.se>
References: <38BE28A9 DOT CD476C62 AT student DOT kuleuven DOT ac DOT be> <38BE4B85 DOT 1F5A0778 AT videotron DOT ca> <l5jsbs87qgu43hr16el30msklmmao5j2h1 AT 4ax DOT com> <38BE7E6D DOT 6FE78AC9 AT americasm01 DOT nt DOT com> <tsg0csclt7k7q6suq7vdcq2gua5aacq8kh AT 4ax DOT com>
NNTP-Posting-Host: mars.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Chris Mears (chris_mears AT softhome DOT net) wrote:
: That "Campbell, Rolf [SKY:1U32:EXCH]" <moscoop AT americasm01 DOT nt DOT com>
: really knows where his towel is.  On Thu, 02 Mar 2000 09:45:01 -0500,
: he wrote:

Ha-ha! Good reference!

: >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? 


Taube,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019