Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Alpha base-26 to base-10...

by Anonymous Monk
on Jul 01, 2003 at 02:47 UTC ( #270383=note: print w/ replies, xml ) Need Help??


in reply to Alpha base-26 to base-10...

How about:

use Math::BaseCalc;
..And then...
my $base_26 = Math::BaseCalc->new(digits=>['A'..'Z']); print "Enter a value: "; while (<>) { chomp; print $base_26->from_base($_)."\n"; print "Enter a value: "; }
CPAN is a beautiful thing. FWIW, there is a bug in your base numbers. In a base-26 set "A" == 0, "B" == 1, etc. TTYL


Comment on Re: Alpha base-26 to base-10...
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://270383]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (19)
As of 2015-07-06 14:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls