(snip, someone wrote)

> o IBM hexadecimal floating-point, HFP,

> o ANSI binary floating-point, BFP, and

> o ANSI decimal floating-point, DFP.

> Of these the first two, HFP and BFP, make zeros positive; but the
> third, DFP, supports both positive and negative zeros.

The change to the Fortran standard comes, I believe, from support
for IEEE binary floating point, which is what went into IBM's BFP.

Among others, the reciprocal of -Infinity is supposed to be negative zero.

DFP, from the new IEEE standard, should also include all the negative
zero properties of the old standard.

(snip, someone else wrote)
> What is x'8000 0000' interpreted as HFP?

I do remember that LNER and LCER generate negative zero, but
I am not sure about some other cases.  How about:

      X=-1e73
      Y=1e-10/X

with exponent underflow mask bit off?

In any case, in all three (HFP, BFP, and DFP) negative zero and
positive zero compare as equal. It is only with tests like SIGN(X)
in Fortran that you can detect negative zero.

Many years ago, I learned that the CALL/OS Fortran compiler
(or, more likely, library) would print +0.0 if given a negative zero.
No sign was printed for positive zero.

-- glen

Reply via email to