How to get different base systems so letters will show up like hex system tia sal2

Discussion in 'Maple' started by temp, Nov 30, 2006.

  1. temp

    temp Guest

    Greetings all
    I now to onvert between different base systems I use convert(17,base,3);
    but how can I get letters to show up in bases like 25 or 40?
    Like in the Hex system.

    Thanks
    SAL2
     
    temp, Nov 30, 2006
    #1
    1. Advertisements

  2. encodenumber := proc(number,encodingbase)
    local basedigit;
    cat( "",
    ListTools[Reverse]([seq](
    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    [basedigit+1:basedigit+1],
    basedigit = convert(number,'base',encodingbase) ) )[] )
    end proc:


    You can extend this past base 37 by adding to the quoted string, if you
    can decide on appropriate symbols for the digits.

    Speaking of appropriate symbols: once you start needing the "O" then
    it is easy to confuse that with "0", so you should consider whether
    a standard alphabetic representation is appropriate.
     
    Walter Roberson, Nov 30, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.