1 To use this package LOADFILE(FORMA1,FASL,DSK,SHARE);.
4 This package is for the pretty printing of floating point
5 numbers in MACSYMA. The printing routine has variable precision
6 feature, and displays a variable number of decimal digits to the left of
7 the decimal point while displaying a fixed number of digits to the right
8 of the decimal point. The advantage of this kind of printing is that it
9 looks most natural to the eye, and because most floating point numbers
10 encountered (of the third kind) in everyday usage is between 1,000,000.0
11 and 0.000,001 in magnitude, using this routine, the magnitude of the
12 number is readily discerned from the length of the display.
14 For example using the defaults for the parameters of the routine,
17 FOR I FROM -10 THRU 10 DO PRINT(10 %PI)
44 In the above example, the number is displayed with 3 non-zero
45 digits most of the time. For a number greater than 9.99, more digits
46 are used so the display becomes longer. The routine also has the
47 feature that it eliminates trailing zeros at the right of the decimal
50 Note that what is displayed has no relation to what is
51 internally stored in the system. The internal representation of a
52 floating point number has a certain precision that only depends on the
53 word length used for storing the floating point number. Displaying the
54 floating point number in its full precision may always be restored by
55 turning off the pretty printing routine.
57 The routine works by repeatedly multiplying or dividing a
58 floating point number, until the number is in the interval [1.0 10.0) .
59 At that point the routine explodes the number. Since the routine keeps
60 the number of left or right decimal shifts it makes, the number may be
61 reconstructed. The parameters are:
65 FLOATFORMAT [True] If true, turns routine on. If false, turns
68 Lisp parameters [defaults]:
70 FLOATFRAC [2] Number of digits right of decimal point in E notation.
72 FLOATMAX [6] All numbers >= 10^floatmax in magnitude are converted to
75 FLOATBIGBIG [1] Number of digits right of decimal point for numbers less
76 than or equal to 10^flotmax and greater than 10^3 in
79 FLOATBIG [2] Number of digits right of decimal point for numbers less
80 than or equal to 10^3 and greater than 1.0 in
83 FLOATSMALL [3] Number of non-zero digits right of decimal point for
84 numbers less than or equal to 1.0 and greater than
85 10^floatmin in magnitude.
87 FLOATMIN [-4] All numbers < 10^floatmin in magnitude are converted to