[Fwd: Re: bit shifting]
Greg & Cindy Gritton
gritton at ibm.net
Thu Apr 23 06:17:03 UTC 1998
Dan Ingalls wrote:
>
> Folks -
>
> First of all, thanks to the several people who answered my questions about whether they had found it to be either useful or enlightening to do bit manipulation with negative numbers.
>
>[...Details of implementation, questions why 2s complement should be used...]
>
> So, if we were to reveal a specific bit representation for the purpose of allowing logic on negative numbers, can anyone explain why it should be two's complement?
>
> - Dan
The simplest reason is because that is what the rest of the world uses.
Most computers use a 2's complement underlying representation for
integers,
and other computer languages treat negative numbers as 2's complement.
(I don't know if such things have made it into the standards.)
Sometimes there are good reasons to be different. In this case, I don't
see one.
Do any of you?
Greg Gritton
More information about the Squeak-dev
mailing list
|