Questions about NCEG

Doug Gwyn gwyn at smoke.BRL.MIL
Mon Jun 4 05:57:24 AEST 1990


In article <8846 at celit.fps.com> ps at fps.com (Patricia Shanahan) writes:
>The issue is even clearer for Fortran.

Thank heavens.

>Fortran users and implementers generally seem to take floating point types
>far more seriously than typical C users and implementers. If distinguishing
>-0.0 from 0.0 is such a good thing, why is it so expressly prohibited, not
>just in early Fortran standards, but in the draft for the next Fortran 
>standard?

I'm not sure I like this line of argumentation, even though it would
lead to a conclusion in line with mine.  Certainly there is no guarantee
that the best possible decisions would be made by the Fortran committee,
although this particular one does sound good to me.

One thing I would like to challenge in this thread is the assumption
that it is rational to specify conformance to IEEE 754 and/or 854.
If I had an engineer working for me and upon being requested to
design a portable format for floating-point representation he had
come back to me with a specification like IEEE 754, I would fire the
bastard on the grounds of professional incompetence.  Not only does
IEEE 754 fail in its primary goal of standardizing the format, but
it invents a multiplicity of variations plus a new fantasy world of
nonstandard mathematics, the latter solely for the reason that in
SOME artificially simple situations, lack of care on the part of
algorithm designers could be automatically compensated for by
carrying invalid arithmetic results as the IEEE 754 special values.
Catering to amateur sloppiness while making life more difficult for
the careful professional is inexcusable in a technical standard.
It is insane to insist on conformance to such an abomination.  At
best, it is a fact of life (especially in the small computer world)
that has to be somehow coped with, hopefully by the implementor of
one's programming language.

>Note that there is nothing about this that prevents a standard conforming
>Fortran implementation from being based on an IEEE floating point conforming
>platform. It just requires a little care on the part of the language 
>implementer to ensure that all zeros are equal to each other and are never
>printed with minus signs.

It is also probably advisable for implementors faced with 68881 etc.
FPUs to implement the programming language's negation operation by
loading a FP register with true_zero then subtracting the expression
to be negated from the register (leaving a sensible negative in the
register even when the expression happens to have zero value).



More information about the Comp.std.c mailing list