[Maxima] printing of floating point numbers and integers in Maxima
fateman at cs.berkeley.edu
Tue Dec 18 18:51:59 CST 2007
Here's what a new version of nformat provides.
are variables set to directives for formatting common lisp numbers in the
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
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,
More information about the Maxima