[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

floating-point format



    Date: Tuesday, 31 May 1983, 23:41-EDT
    From: David A. Moon <Moon%SCRC-TENEX%MIT-MC@SU-DSN>

    ...
    16. Guy proposes the following treatment of floating point in FORMAT:

	    ~w,d,pF
	    ~w,d,x,pE
	    ~w,d,pG

    The meanings of the arguments are exactly as for the FORTRAN-77
    language as described in chapter 13 of the FORTRAN-77 standard,
    with the following exceptions and extensions:
    ...
    From ANSI X3.9 1978  (selected highlights from chapter 13)

    F editing: Optional blanks, optional sign, and a string of digits that
    contains a decimal point, rounded to d fractional digits.  Leading zeros
    are not permitted except for an optional zero immediately to the left of
    the decimal point if the magnitude is less than one.  The optional zero
    must appear if there would otherwise be no digits in the output field.
    [It says nothing about trailing zeros.]

I guess we need to be specific about rounding.  The spirit of Fortran,
if not the letter, is that all digits printed are rounded in decimal.
(Specified for F-format, but not for E-format.)
Fortran rounding on ties is away from zero.  (2.5 => 3, -2.5 => -3)
IEEE says that binary-decimal conversions must respect the rounding
mode, and the default rounding mode rounds to even on ties.

Do we want to require that all digits printed be decimal-rounded for all
formats?  [I think so.]

What rounding happens on ties?  [I don't care -- either Fortran rounding
or round-to-nearest-even is acceptable.]