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

1.0e+6 vs 1.0E+6, more food for thought



    Date: 22 February 1984 21:47-EST
    From: Glenn S. Burke <GSB @ MIT-MC>

	Received: from MIT-AVATAR by MIT-OZ via Chaosnet; 22 Feb 84 17:22-EST
	Date: Wednesday, 22 February 1984, 17:22-EST
	From: Kent M Pitman <kmp%MIT-OZ@MIT-MC.ARPA>

	In Release 4.5 on PA Lisp Machine Avatar:

	It would be nice if there were an advertised switch variable
	controlling whether floating point numbers printed with the
	"e" in complemented case. In particular, we use the Lisp floating
	point number printer to display floating point numbers in the
	PL/1 component of our system and since PL/1 is, in most 
	implementations, case sensitive, we'd prefer in that context
	to see the E in the same case as the rest of the code. Is this
	reasonable or should we just use ~ ?

In release 5, I completely redid the floating-point reader and printer.
They are now "completely accurate" and more modular.  So Fortran and
Pascal, which have different notions from Lisp about how formatting
should be done, use the lower-level routines.  I suggest you do the same
for PL/I, so you can get the semantics exactly right (the way you want
them).  You can follow pointers from SI:PRINT-FLONUM and
SI:XR-READ-FLONUM or just look in SYS: SYS2; NUMER.  It should be
obvious how to use upper-case exponent marks.  If you have trouble
understanding the other (myriad) options, let me know.  If it'll help,
ask and I'll send you copies of the Fortran and/or Pascal floating-point
printers.

    NIL had been printing floating point exponents in lower case by default,
    but i changed it back to upper case because most people got confused by
    long floats with the lower case "l" exponent marker embedded in the output.
    (I haven't done the common-lisp printing stuff yet.)  Anyone else
    out there in CL land have this experience, or suggestions?

It certainly occurred to me when I was doing the Common Lisp printer
that "l" would be a loser.  Since we don't have long floating-point
numbers, we'll never print them.  The feeling here was that lower-case
is easier to read for "e", "d", and "s", so we left it printing
lower-case.  If we ever implement longs, we'll have to reconsider.