Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by sauoq (Abbot)
on Jul 01, 2003 at 00:15 UTC ( #270368=note: print w/ replies, xml ) Need Help??


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

I'd prefer something more readable than concise. It's a concise enough problem anyway.

sub b26_to_b10 { my $base_10 = 0; for (split //, lc shift) { $base_10 *= 26; $base_10 += ord() - 96; } return $base_10; }
-sauoq
"My two cents aren't worth a dime.";


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2014-12-21 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls