Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: int2interval, frac2interval, rat2interval - signed integer zeros



Vincent Lefevre <vincent@xxxxxxxxxx> wrote on 04/20/2012 11:55:39 AM:
> On 2012-04-20 16:15:20 +0100, N.M. Maclaren wrote:
. . .
> > As far as computational integers and floating-point goes, either or
> > both can have signed zeroes, and the problems are almost identical.
>
> Signed zeroes are a bad idea for integers (even for floating-point,
> it wasn't a very good idea). And almost all implementations do not
> support signed zeroes for integers (actually I don't know any
> integer implementation with signed zeroes, and really seen as
> signed at Level 2). P1788 must ignore them.
. . .


In the 1970s and 80s I used Control Data computers including the 3500, and the 6600 and its 6x00, 7600 and CYBER 7x/17x/7x0 successors. CDC's machines from that era used ones-complement integers. That had two implications:
- The negative and positive ranges were symmetrical, unlike twos-complement which has an extra negative value.
- There were two representations of zero, one with all zero bits and one with all on bits.
The two zeros of course compared equal to each other.

I don't know of any modern ones-complement systems.

- Ian McIntosh IBM Canada Lab Compiler Back End Support and Development