Re: IEEE arithmetic handling

bill@amber.csd.harris.com (Bill Leonard)
Fri, 20 Nov 1992 16:30:20 GMT

          From comp.compilers

Related articles
[2 earlier articles]
Re: IEEE arithmetic handling eggert@twinsun.com (1992-11-16)
Re: IEEE arithmetic handling bill@amber.csd.harris.com (1992-11-16)
Re: IEEE arithmetic handling jlg@cochiti.lanl.gov (1992-11-17)
Re: IEEE arithmetic handling eggert@twinsun.com (1992-11-17)
Re: IEEE arithmetic handling tmb@arolla.idiap.ch (1992-11-18)
Re: IEEE arithmetic handling bart@cs.uoregon.edu (1992-11-19)
Re: IEEE arithmetic handling bill@amber.csd.harris.com (1992-11-20)
Re: IEEE arithmetic handling bill@amber.csd.harris.com (1992-11-20)
Re: IEEE arithmetic handling Dik.Winter@cwi.nl (1992-11-23)
Re: IEEE arithmetic handling bright@nazgul.uucp (Walter Bright) (1993-01-07)
| List of all articles for this month |

Newsgroups: comp.compilers
From: bill@amber.csd.harris.com (Bill Leonard)
Organization: Harris CSD, Ft. Lauderdale, FL
Distribution: ssd
Date: Fri, 20 Nov 1992 16:30:20 GMT
Keywords: arithmetic
References: 92-11-041 92-11-097

eggert@twinsun.com (Paul Eggert) writes:


> But that conflicts with IEEE Std 754-1985, section 5.6, which requires
> that converting a number from binary to decimal and back be the identity
> if the proper precision and rounding is used. The Fortran standard says
> -0.0 must be output as 0.0; this loses information.


But IEEE doesn't say *how* that conversion must be done.


> One way to work around the problem is to supply IEEE-specific
> binary/decimal conversion routines to the Fortran programmer, but there's
> no standard for this, and most implementors don't bother. So in practice,
> I'm afraid that Fortran and IEEE are indeed in conflict here.


Then what you are saying is the IEEE standard is insufficient, since it
did not specify how to get at the features from programming languages. I
simply object to using the word "conflict", when the truth is that the two
standards address different audiences. The IEEE 754 committee *could*
have asked the Fortran committee for guidance in how to specify access to
the IEEE features from the language, but they didn't; they left it
unspecified.


The Fortran standards committee's charter does not include specifying how
you access architecture-specific facilities. Its charter *does* say that
it should make Fortran as widely available as possible, which means
staying away from architecture-specific features.


As for the specific case of negative zero, this is a requirement of
Fortran 77 (which, again, predated IEEE 754) that was made for reasons
which have little to do with whether a machine supports, or doesn't
support, signed zero. The issue, I believe, was predictability of output.


Why is negative zero so important, anyway? It has no mathematical
interpretation -- in mathematics, zero is neither positive nor negative.
It certainly is a nuisance and performance hit to support it in compilers,
but I've never heard any justification for its existence.


--
Bill Leonard
Harris Computer Systems Division
2101 W. Cypress Creek Road
Fort Lauderdale, FL 33309
bill@ssd.csd.harris.com
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.