printing of floating point numbers and integers in Maxima



Here's what a new version of nformat provides.

floatformat
integerformat

 are variables set to directives for formatting common lisp numbers in the
display.

The default format for each is "~s", but can be changed as follows:

floatformat:"~e"  ;  uses  ... E notation.  You can also set it to "~5,4e"
which uses 5 digits, 4 after the decimal.

integerformat:"~r"  prints integers in English, e.g. "four hundred one"
integerformat:"~@r" prints integers in Roman numerals, e.g. CDI for 401.

You can see binary by integerformat:"~b"
Or other bases.

Bigfloats are not affected.

And yes, the sizes of objects work fine. Try
matrix([1,2,3],[4,5,6],[7,8,9])^^2;
look at the result with integerformat:"~r".
Then change to "~b" and look at the result again.





The code is also cleaned up, some. Perhaps a kind soul will test it out and
install it if it works?
It belongs in nformat.lisp.

To try it out, download it to your computer and load it in to your xmaxima,
wxmaxima, etc.

RJF

http://www.cs.berkeley.edu/~fateman/generic/nnformat.lisp