On 5/6/07, sen1 at math.msu.edu <sen1 at math.msu.edu> wrote:
> How does one get different formats for integers in maxima?
>
> For instance, to go from integers (standard format) to hexadecimal and
> vice versa.
In console i/o, the output base is controlled by obase,
and theoretically the input base is controlled by ibase, but that
hasn't worked since I don't know when.
See also printf which is a share function which understands a lot
of output formatting indicators including octal and hexadecimal.
About ibase, I've attached a patch to this message which makes
the Maxima parser understand ibase > 10. In the parser,
(DIGIT-CHAR-P X) is replaced by (DIGIT-CHAR-P X *READ-BASE*).
Note that even when ibase is not 10 (decimal), a trailing decimal
point forces interpretation in base 10. This is a Lispism
inherited by Maxima.
This topic comes up from time to time. Last time I proposed
essentially the same modification (the code was slightly different)
it was rejected. See:
http://www.math.utexas.edu/pipermail/maxima/2006/001887.html
I'll take this opportunity to propose it again. Any objections?
HTH
Robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nparse.lisp-ibase-patch
Type: application/octet-stream
Size: 1587 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20070507/0e80096c/attachment.obj