Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:

I was thinking last night about how hexadecimal can store more info than decimal in the same number of chars. A six-digit number in hex can have up to 16,777,216 possible values.

I don't normally see other bases used, but there is another scheme which comes up from time to time, the kind of "alphabetical" system. I guess it's technically base 26.

If use use it, a six-digit number can have up to 308,915,776 possible values.

Is it used for anything? Perl can "count" using this scheme can't it? I mean I can do "for(AA..ZZ){$x++};print $x;" and get 676 for instance.

Does it have a name?


--
($_='jjjuuusssttt annootthhrer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;

Replies are listed 'Best First'.
Re: Does AA..ZZ have a name?
by mdillon (Priest) on May 04, 2002 at 02:01 UTC
    I've seen it referred to as "latin numbering". For instance, see Number::Latin (especially the NOTES section of the POD). It isn't a normal base-N system, since there isn't a "zero" character.
      I'm going to call it "alphadeximal" or something if it hasn't got a more interesting name. What would greek for twenty-six be anyway? Do-deca-heximal?
      --
      ($_='jjjuuusssttt annootthhrer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;
        Ancient greek for twenty-six is "eikosi (kai) hex" or "hex (kai) eikosi(n)". 26 is κϝ′ (or κϛ′). (Smyth 347 D) I guess that might make the English word "hexecosinal" or some such (I don't think there is any Greek-derived word for base 26 in English).

        However, since "decimal" and cousins come from Latin, you would want a word like "sevigesimal" ("vigesimal" is the adjective for base 20 and "sedecimal", not "hexadecimal" is the fully latinate adjective for base 16). But, as I said before, this is not a base-N numeral system, so it shouldn't be called "sevigesimal".

        Update: Here is an interesting link. Also, interestingly, as with "hexadecimal"/"sedecimal", apparently there is a mixed Greek-Latin form for base 17, "heptadecimal" in addition to the latinate "septendecimal".

        Update 2: changed "κς′" to "κϝ′ (or κϛ′)". The sigma+tau symbol in my printed copy of Smyth looked like a final sigma, so I assumed that and didn't actually think about it being wrong for sigma to come between epsilon and zeta. I was further confused by the use of a normal sigma in the chart on the online version of Smyth. This all struck me at some point when I recalled learning in school that the symbol is actually "digamma", so I've since sorted things out and amended this post.

Re: Does AA..ZZ have a name?
by seattlejohn (Deacon) on May 04, 2002 at 08:01 UTC
    The one place that stands out to me as an example of the A..Z, AA..AZ, BZ...ZZ "numbering" scheme in action is in the names of columns in spreadsheets. Using letters instead of numbers then allows you to specify a row-column intersection unambiguously using terminology like "BB45".

    A few other obscure uses for this kind of thing come to mind, like generating the alphabetic portions of license plates in many U.S. states, or using alphabetic characters to generate unique product IDs that are briefer than decimal or hexadecimal ones.

Re: Does AA..ZZ have a name?
by vagnerr (Prior) on May 05, 2002 at 13:24 UTC
    We use 0-9,A-Z or base 36, for our reference numbers, for exactly the reason you describe, to get as big a range a possible in just 18 Characters. Our IT director decided to call each one a Ligit which kind of stuck.

    ---If it doesn't fit use a bigger hammer
Re: Does AA..ZZ have a name?
by boo_radley (Parson) on May 04, 2002 at 22:55 UTC
    Before the stark fist of HTTP and HTML crushed all who opposed it, there was a protocol called RIP, which used [0-9A-Z] for its numbering. RIP allowed sysops to put up vector graphics, and create windowing systems and other things for their bbses. They called them meganums. The idea caught on for a brief time, and then the internet rolled over it like a tank.
    If you've a morbid curiosity, http://thebbs.com has a bunch of info on them (Look for RIP screens, utilites, etc.)
    Its death was not a bad thing, since RIP was brutish and ugly...
A reply falls below the community's threshold of quality. You may see it by logging in.