trailing decimal point and scanning integers / floats
Subject: trailing decimal point and scanning integers / floats
From: Robert Dodier
Date: Wed, 9 Nov 2005 17:53:35 -0700
Hello,
To recap -- Maxima punts to Lisp to convert digits + trailing decimal point
to a number. Lisp recognizes the trailing . as an indicator that the digits
are to be interpreted in base 10. Maxima has a provision to change the
input or output base (ibase and obase) but there is no way to indicate
the base in the number itself, so far as I know.
There have been suggestions to make Maxima recognize nnnn. as a float.
I'm in general agreement, but at present the trailing . plays a role
which can't be duplicated without some kludging, namely that whatever
the ibase, you can guarantee a number will be interpreted in base 10.
That would be useful, for example, to reset the ibase to a known value.
So what I'd like to see is that base 2, 8, 10, and 16 can be indicated
in the number itself, say by using a prefix. Then trailing . can be safely
reinterpreted to indicate a float.
Lisp has #b, #o, trailing . , and #x for 2, 8, 10, and 16,
and #r for general base. I wouldn't mind #b, #o, #d, #x, and
#r except that # already means not equal.
I guess a leading backslash like \#xabcd0123 isn't out of the question ....
For what it's worth,
Robert Dodier