[Info-vax] Off-Topic: UNISYS problems
Arne Vajhøj
arne at vajhoej.dk
Thu Nov 10 18:52:21 EST 2022
On 11/10/2022 4:06 PM, gah4 wrote:
> 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.
OK.
I think it did on CDC Cyber NOS.
I remember seeing code adding B0 (always zero) to Xn to
ensure that if Xn contained zero then it was plus zero
not minus zero.
Arne
More information about the Info-vax
mailing list