Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2015-07-07 21:10 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 (93 votes), past polls