Re: printing floats, bigfloats, fortran floats



Hello all,

Some random notes on this topic, after perusing the source code ...

(1) Maxima MAKE-NUMBER punts to READ-FROM-STRING to
parse integers and floats (but not bigfloats).

(2) READ-FROM-STRING ignores *READ-BASE* when parsing floats,
but Maxima constructs bigfloats from integers, so when *READ-BASE*
is something other than 10., 100b0 is not anywhere close to 100e0 e.g.

(3) Maxima ibase and obase correspond to *READ-BASE* and *PRINT-BASE*
resp. obase other than 10. seems to yield the expected result (e.g. 10 => A
when obase = 11). However the Maxima input scanner apparently doesn't
consult ibase, so one might hope 1A is recognized as a number but the
scanner stops gathering digits when it sees the A.

(4) Some input tokens which could be construed as numbers are
considered symbols by Maxima, e.g. ?#x3fa

(5) Incidentally READ-FROM-STRING returns a symbol if given
something which contains digits other than those allowed by *READ-BASE*.
E.g. "678" => |678| when *READ-BASE* is 8.
In Maxima, ibase : 8. ; 678 - 1; => 678 - 1

(6) Lisp recognizes base 2, 8, 10, and 16 numbers via #b, #o, and #x
prefixes for 2, 8, and 16, and the trailing decimal point for 10.

I wouldn't mind seeing (in Maxima) a uniform syntax for common bases
(e.g., #d for decimal). Of course this last bit hinges on getting Maxima
to recognize a radix prefix or suffix or something ....

For what it's worth,
Robert Dodier