ibase > 10



On 4/9/07, Guenter Nowak <guenter.nowak at gmx.at> wrote:

> can anybody tell me how i can input numbers if ibase > 10?

Here is a modification of the Maxima function ASCII-NUMBERP
which allows ibase > 10. This works in versions of Maxima up to
and including 5.11. It won't work in 5.12 (not yet released) so if
this question is still interesting to you when you're running 5.12,
let me know.

(defun ascii-numberp (putative-digit)
  (and
   (characterp putative-digit)
   (find
    (char-downcase putative-digit)
    (subseq "0123456789abcdefghijklmnopqrstuvwxyz" 0 *read-base*))))

This topic has been discussed before. I proposed making the
above change but the idea met with resistance. See
http://www.math.utexas.edu/pipermail/maxima/2006/001887.html
and its followups.

Looking at the above code, it can probably be simplified;
maybe (defun ascii-numberp (x) (digit-char-p x *read-base*))
would be enough, but I haven't tried it.

HTH
Robert Dodier