bitwise not - not what I expected
Grant Edwards
grante at visi.com
Sun Aug 17 23:12:36 EDT 2003
In article <bhosrr$u57$06$1 at news.t-online.com>, Michael Peuser wrote:
> I have the impression (may be wrong) that you are working under the
> misconception that there can be a "natural" binary represensation of
> negative numbers!?
> Three conventions have commonly been used so far:
> 1- Complement
> 2- Complement
> Sign tag plus absolut binary values
>
> All of them have their pros and cons. For a mixture of very technical
> reasons (you mentioned the +0/-0 conflict, I might add the use of binary
> adders for subtraction)
The latter is _far_ more important than the former. Being able
to use a simple binary adder to do operations on either signed
or unsigned values is a huge savings in CPU and ISA design. I
doubt that anybody really cares about the +0 vs. -0 issue very
much (IEEE FP has zeros of both signs, and nobody seems to
care).
> most modern computers use 2-complement, and this now leads to
> those funny speculations in this thread. ;-)
--
Grant Edwards grante Yow! An Italian is COMBING
at his hair in suburban DES
visi.com MOINES!
More information about the Python-list
mailing list