hexadecimal and binary expressions/conversions



I know the following:

(%i1) printf(true,"~b",123)$
1111011
(%i2) printf(true,"~o",123)$
173
(%i3) printf(true,"~x",123)$
7B
(%i4) printf(true,"~36r",123)$
3F

"~nr" n can be between 2 and 36

global variables:

(%i5) obase:16$
(%i6) 123;
(%o6)                                 7B
(%i7) (obase:10,ibase:2)$
(%i8) 101010;
(%o8)                                 42

the output base obase can be between 2 and 35
the input base ibase can be between 2 and 10

For hexadecimal to decimal I do not any builtin.

HTH
Volker


Am 19 Apr 2008 um 12:55 hat S. Newhouse geschrieben:

> Hello,
>    Does maxima have built in functions to do binary and/or hexadecimal 
> conversions (in various precisions)?   I know one can write routines to 
> do this, but I wondered if it is already there.
> 
> TIA,
>  -sen
>