[comp.lang.c] ANSI C & floating point

dgh%dgh@Sun.COM (David Hough) (12/08/87)

I have finished the first draft of a document on this subject and shipped
it off to the ANSI C committee, meeting this week at the Driskill Hotel
in Austin.  I will continue to sharpen and expand my commentary based
on feedback from colleagues until the next formal public review period.

So far the following have indicated agreement with most of what I've 
proposed:

        Larry Breed        ibmpa!lmb
        W. J. Cody         cody@anl-mcs.arpa
        Zhishun Alex Liu   zliu%hobbes@berkeley.edu
        K-C Ng             kcng@sun.com
        Gene Spafford      spaf@purdue.edu
        Jim Valerio        omepd!radix!jimv

If you are interested in troff source, please send me mail - don't post to news!
You won't need to post if you remember to include a bullet-proof usenet or arpa
return address.  Please specify if you are interested in the comments
submitted to X3J11 on 7 December 1987 or the ever-evolving most current version.

If you're not sure, here's the executive summary.  troff source is almost
60K bytes and thus unsuitable for posting:

          The proposed  C  standard  suffers  numerical
     shortcomings - many inherited from its precursors
     -  in  the  areas  of  expression  evaluation  and
     floating-point exception handling, particularly in
     the library  of  elementary  transcendental  func-
     tions.  The following comments are included:
 
Comment #1, Section 3.2.1.4:    round conversions between floating types
Comment #2, Section 3.3.3.3:    don't define unary + and - with formulas
Comment #3, Section 4.7:        SIGFPE means floating point
Comment #4, Section 4.9.6.1:    printf %+ displays signed zero
Comment #5, Section 4.9.6.1:    printf %f distinguishes exact zero
Comment #6, Section 4.9.6.2:    scanf requires pushback > 1
Comment #7, Section 4.10.1.4:   strtod/atof are mathematical functions
Comment #8, Section 4.10.2:     require two random number generators
Comment #9, Section A.5:        forbid implicit narrowing conversions
Comment #10, Section 3.5.2.3:   facilitate forcing rounding
Comment #11, Section 3.3:       opaque parentheses by default
Comment #12, Section 3.4:       opaque parentheses defer constant expression 
				evaluation
Comment #13, Section 3.3.3.3:   respect opaque parentheses in expression 
				evaluation
Comment #14, Section 2.2.4.2:   <float.h> has too many names, 
				not enough information
Comment #15, Section 2.2.4.2:   long double > minimal float
Comment #16, Section 4.9.6:     printf/scanf duality for non-model numbers
Comment #17, Section 4.5:       specific mathematical library functions
Comment #18, Section 4.13.2:    standard functions predefine generic operators
Comment #19, Section 4.5:       make numerical exception handling uniform


David Hough

ARPA: dhough@sun.com
UUCP: {ucbvax,decvax,allegra,decwrl,cbosgd,ihnp4,seismo}!sun!dhough