Hi Alexander,
it is better to post new code to the maxima mailing list. I'm
forwarding your message to the list. If more people find it
interesting, maybe it could be added to the contrib directory. I think
people were interested in base conversion before.
Andrej
On Tue, Oct 28, 2008 at 4:18 PM, Alexander Hausner <alex at hugo.bmg.gv.at> wrote:
> Dear Andrej,
>
> I've been searching for a way to convert big numbers into different base
> systems with maxima, but I have not found any way out of the box.
>
> So, I've written a small package (see attachment). Maybe this could be useful
> for someone else.
>
> You can convert numbers from one to another base system with the function
> base_conv(value,f_base,t_base), for example:
>
> (%i2) base_conv("-10abbe.7ffe",16,2);
> (%o2) -100001010101110111110.011111111111111
> (%i3) base_conv(%o2,2,16);
> (%o3) -10abbe.7ffe
>
> converts "-10abbe.7ffe" from hex (base 16) to bin (base 2) and vice versa.
>
> or:
>
> (%i6) base_conv(string(50!),10,25);
> (%o6) 1cg6j30cn5jjk0a348h1822141bfkagl01n0i9bb2000000
>
> converts 50! to a system with base 25
>
> Regards,
>
> Alexander Hausner
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: base_conversion.mac
Url: http://www.math.utexas.edu/pipermail/maxima/attachments/20081028/e36d03f7/attachment.diff