[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
floating-point format
- To: Common-Lisp@SU-AI
- Subject: floating-point format
- From: David A. Moon <Moon%SCRC-TENEX%MIT-MC@SU-DSN>
- Date: Wed, 01 Jun 1983 03:41:00 -0000
I went and read the Fortran-77 standard, so now I understand Guy's
proposal.
This mess consists of several sections, separated by rows of dashes:
Guy's proposal (from the memorial day ballot); a condensed form of
the Fortran FORMAT-statement documentation; my suggestions; and the
documentation for ~$ as its exists now in the Lisp machine (Scribe
commands and all).
----------------
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:
(a) The scale factor p is an explicit parameter, rather than being
established be a separate preceding directive. For ~F, p defaults to 0,
and for ~E and ~G it defaults to 1. (In FORTRAN p always defaults
to 0.)
(b) If w is omitted, then the output is variable-width, and never
produces a field of asterisks; the other parameters are observed,
however. So "~,2F" will always print exactly two digits after the
decimal point, and prints as many as necessary to the left of
the decimal point.
(c) If d is omitted then as many digits are produced as necessary
to preserve the information content of the number, except that if
w is specified then the width constraint it imposes overrides this
consideration. (Thus if both are omitted we get free-format output.)
(d) The format operation formerly called ~G will henceforth be called ~@*.
----------------