1 Pretty printing of floating point numbers.
2 Do LOADFILE(FORMAT,FASL,DSK,SHARE);
4 Nothing is changed unless you do FLOATFORMAT:TRUE; (default is FALSE)
5 Then all floating point numbers are printed in a field of FLOATWIDTH
6 character positions (default 10) with FLOATPREC significant figures
7 (default 3) and FLOATINT (default 1) figures before the decimal point.
8 (FLOATINT may also be a list of 3 integers, in which the first gives the
9 no. of digits before the decimal point and the other two specify the
10 range of powers of 10 for which the "E" format is not used.)
12 Alternately you can do FLOATFORMAT:'F; in which case the "E" notation
13 is not used and FLOATFRAC figures appear after the decimal point.
14 The total width is again FLOATWIDTH.
16 In either case if FLOATWIDTH is 0, then only the digits themselves will
17 be part of the number. (I.e there will be no leading spaces.)
19 The printing is also governed by FLOATOPTIONS (default FALSE). This
20 may be set to a list of items, which should be any of:
21 "+" print + for positive integers
22 LEFT place sign in leftmost column instead of by leftmost digit
23 0 print trailing zeros
24 E force E format for fixed precision output
25 E.g. FLOATOPTIONS:['"+",'E];
27 If you specify too large a precision, or small a width, then the number
28 will appear in the default manner.
30 Currently the Macsyma displayer (the guy that prints D and E lines),
31 PRINT and CONCAT will use this method of printing floating point numbers.
32 SAVE, STRING and STRINGOUT do not, so there should be no loss of precision
33 in doing a SAVE followed by a LOADFILE or a STRINGOUT followed by a
36 For fuller documentation do :PRINT LIBDOC;FFORMA >
37 which documents the Fortran-style-FORMAt package (written by JONL), and
38 is the support for the formatter herein discussed.
39 There might be a better user interface provided if there is a consensus
40 on how it should be done.
43 LOADFILE(FORMAT,FASL,DSK,SHARE);
47 FOR I FROM -10 THRU 10 DO PRINT(10^I*PI);
70 FOR I FROM -10 THRU 10 DO PRINT(10^I*PI);
94 FOR I FROM -10 THRU 10 DO PRINT(10^I*PI);
117 Comments etc. to CFFK@MC