[Info-vax] Off-Topic: UNISYS problems

gah4 gah4 at u.washington.edu
Thu Nov 10 16:06:37 EST 2022


On Thursday, November 10, 2022 at 12:08:30 PM UTC-8, Arne Vajhøj wrote:
> On 11/10/2022 9:45 AM, Scott Dorsey wrote: 

(snip)
> > Could be. Last week the stock was at zero but THIS week it's at negative zero!
> But then they would just need to add zero to get back. 

There are two ways usually used to build ones' complement machines.

Some compare +0 and -0 as equal.

Others use a ones' complement subtractor, and complement first for add.

If it is done right, you never get negative zero out, when the operands are
not negative zero.  

If you want to see the effect of all this, read the Unisys C compiler manual.

C allows ones' complement for signed integers, which is fine.
But unsigned integers have to work modulo the appropriate power of 2.

The Unisys hardware doesn't do that so well.

In any case, it is not guaranteed that -0 + +0 gives +0.






More information about the Info-vax mailing list