The Full Wiki

More info on Hexavigesimal

Hexavigesimal: Wikis

Advertisements

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

Encyclopedia

From Wikipedia, the free encyclopedia

Numeral systems by culture
Hindu-Arabic numerals
Eastern Arabic
Indian family
Khmer
Mongolian
Thai
Western Arabic
East Asian numerals
Chinese
Counting rods
Japanese
Korean
Suzhou
Alphabetic numerals
Abjad
Armenian
Āryabhaṭa
Cyrillic
Ge'ez
Greek (Ionian)
Hebrew
Other systems
Attic
Babylonian
Brahmi
Egyptian
Etruscan
Inuit
Mayan
Quipu
Roman
Urnfield
List of numeral system topics
Positional systems by base
Decimal (10)
1, 2, 3, 4, 5, 8, 12, 16, 20, 60 more…

A hexavigesimal numeral system has a base of twenty-six.

Base-26 may be represented by using conventional numerals for the digits 0 to 9, and then the letters A to P for the tenth to twenty-fifth digits. "10" would represent 26, "11" = 27, "AB" = 271 and "NP" = 623.

Alternatively, base-26 may be represented using only letters of the Latin alphabet. As there are 26 letters in English, base-26 is also the highest base in which this is possible and hence utilizes every letter. 0 is represented by A, 1 = B, 2 = C ... 24 = Y, 25 = Z. Some examples: 26 = BA, 678 = BAC.

These systems are 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.

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.

Conversion algorithm (alphabet-only system)

Any number may be converted to base-26 by repeatedly dividing the number by 26. The remainders of each division will be the base-26 digits from right to left (least-significant to most-significant place). For example, to convert 678 to "BAC", the first division yields 26 remainder 2, so 2 (C) is the last digit. The quotient 26 is divided again, yielding 1 remainder 0, so 0 (A) is the second-last digit. The next quotient 1 is then divided to give 0 remainder 1, so the final digit is 1 (B). This is extensible to fractions.

This algorithm may be represented in Java to convert an integer to a base-26 character string as follows:

public static String toBase26(int number){
  String converted = "";
 
  // Repeatedly divide the number by 26 and convert the
  // remainder into the appropriate letter.
  do {
    int remainder = number % 26;
    converted = (char)(remainder + 'A') + converted;
    number /= 26;
  } while (number > 0);
 
  return converted;
}

This algorithm may, also, be represented in Microsoft Transact SQL to convert an integer to a base-26 character string as follows

CREATE FUNCTION [dbo].[base26alpha] (
     @base10int bigint
)
returns varchar(max)
AS
     begin
          declare @ret varchar(max)
          declare @remainder int
          declare @number bigint
          declare @onechar char(1)
          SET @ret=''
          SET @number=@base10int
          IF (@number=0)
               begin
                    SET @ret='A'
               end
          else
               begin
                      while (@number>0)
                              begin
                                   SET @remainder = @number % 26
                                   SET @onechar=char(65 + @remainder)
                                   SET @ret = @onechar + @ret
                                   SET @number=@number/26
                              end
                    end
          RETURN @ret
     end

The reverse conversion is achieved by processing each base-26 digit from left to right. The value of the first (leftmost) digit is multiplied by 26 and then added to the subsequent digit. If digits remain, then the cumulative sum is multiplied by 26 before adding the next digit, and so on. Note that this works for any base as long as one has the tools to perform multiplication by 26 and addition in that base. For example, to convert "BAC" to 678, B (1) is multiplied to give 26 and added to A (0) to yield 26. This is multipled to give 676 and added to C (2) to yield 678.

Advertisements

Advertisements






Got something to say? Make a comment.
Your name
Your email address
Message