Hexavigesimal
From Wikipedia, the free encyclopedia
Numeral systems by culture | |
---|---|
Hindu-Arabic numerals | |
Indian Eastern Arabic Khmer |
Indian family Brahmi Thai |
East Asian numerals | |
Chinese Counting rods |
Japanese Korean |
Alphabetic numerals | |
Abjad Armenian Cyrillic Ge'ez |
Hebrew Greek (Ionian) Āryabhaṭa |
Other systems | |
Attic Babylonian Egyptian Etruscan |
Mayan Roman Urnfield |
List of numeral system topics | |
Positional systems by base | |
Decimal (10) | |
2, 4, 8, 16, 32, 64 | |
1, 3, 9, 12, 20, 24, 30, 36, 60, more… | |
A Hexavigesimal numeral system has a base of twenty-six.
Base 26 is a fairly natural way of representing numbers as text using the 26-letter Latin alphabet. The number of interest is expressed in base 26, and then the 26 different base-26 digits are identified with letters as 0=A, 1=B, 2=C, ... 25=Z. Some examples: 26 = BA, 678 = BAC.
This system is of limited practical value, although letters used in nominal or serial numbers can be thought as hexavigesimal numerals for calculation purposes if the entire alphabet is used.
A Hexavigesimal numeral system has a base of twenty-six.
[edit] Fractions
The fact that 26 is a composite number and lies between two composite numbers (25 and 27) leads to many simple fractions.
B/C = A.N B/D = A.IRIRIRIR... B/E = A.GN B/F = A.FFFFFFF...
The fractions B/G, B/I, B/J, B/K, B/M, B/N, B/P, B/Q are also simple.
[edit] Example Encoding Algorithm
This Java implementation shows how to convert base10 to base26. For the sake of simplicity StringBuffer or StringBuilder wasn't used. 97 is a magic number which refers to the ASCII code of the letter 'a' . Note that you can actually replace the 97 with 'a' in Java. However, it's not that easy with every language, hence the magic number, which should make porting a bit easier.
public static String toBase26(int i){ String s=""; while(i>25){ int r=i%26; i=i/26; s=(char)(r+97)+s; } s=(char)(i+97)+s; return s; }