[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: bradd+srfi@xxxxxxxxxx*Subject*: Re: Twos complement assumption, other issues*From*: Aubrey Jaffer <agj@xxxxxxxxxxxx>*Date*: Fri, 28 Jan 2005 19:53:52 -0500 (EST)*Cc*: srfi-60@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-60@xxxxxxxxxxxxxxxxx*In-reply-to*: <20050127190424.GB16359@xxxxxxxxxxxxxxx> (bradd+srfi@xxxxxxxxxx)*References*: <y9lis5y7fjr.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20050127190048.7DB7A1B7730@xxxxxxxxxxxxxxxx> <20050127190424.GB16359@xxxxxxxxxxxxxxx>

| Date: Thu, 27 Jan 2005 11:04:24 -0800 | From: "Bradd W. Szonye" <bradd+srfi@xxxxxxxxxx> | | Aubrey Jaffer wrote: | > Since we treat integers as having two's-complement negations, | > the two's-complement of an integer is its negation. The | > one's-complement of an integer is computed by lognot: | > | > (define (lognot n) (- -1 n)) | | Isn't that backwards? Complement and negation are equivalent in | ones- complement arithmetic; in twos-complement, the complement is | equal to negation minus one. Perhaps I'm not understanding your | explanation clearly. Taking the one's-complement of a number is the process of exchanging '1' for '0' and '0' for '1'. That is LOGNOT. When we talk of *'s-complement representation, it is about which process is used to negate a number. SRFI-60 treats its integers as two's-complement. Therefore the process of taking the one's-complement is different from the native negation. It is difficult to keep straight. In the specification section, the description of LOGNOT incorrectly says two's-complement.

**References**:**Twos complement assumption, other issues***From:*Laura Dickey

**Re: Twos complement assumption, other issues***From:*Aubrey Jaffer

**Re: Twos complement assumption, other issues***From:*Bradd W. Szonye

- Prev by Date:
**Re: Twos complement assumption, other issues** - Previous by thread:
**Re: Twos complement assumption, other issues** - Next by thread:
**Re: Twos complement assumption, other issues** - Index(es):