NUMBERS

Note that, in some fonts, the digits ??? are easily misidentified and some implementations of higher bases exchange other, non-alphabetic characters for them. In that case, the names of those systems are often called something else, e.g., Base62ner(???).

Array of digits for bases up to 62

@Number::More::dec2digit = <
   0 1 2 3 4 5 6 7 8 9
   A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
   a b c d e f g h i j k l m n o p q r s t u v w x y z
   >;

Hash of reversed mapping of the array above

%Number::More::digit2dec = [
   0 =>  0, 1 =>  1, 2 =>  2, 3 =>  3, 4 =>  4, 5 =>  5, 6 =>  6, 7 =>  7, 8 =>  8, 9 =>  9,
   A => 10, B => 11, C => 12, D => 13, E => 14, F => 15, G => 16, H => 17, I => 18, J => 19,
   K => 20, L => 21, M => 22, N => 23, O => 24, P => 25, Q => 26, R => 27, S => 28, T => 29,
   U => 30, V => 31, W => 32, X => 33, Y => 34, Z => 35, a => 36, b => 37, c => 38, d => 39,
   e => 40, f => 41, g => 42, h => 43, i => 44, j => 45, k => 46, l => 47, m => 48, n => 49,
   o => 50, p => 51, q => 52, r => 53, s => 54, t => 55, u => 56, v => 57, w => 58, x => 59,
   y => 60, z => 61
];

Names for some common base numbers [Ref 6.]

BaseNumber SystemBaseNumber SystemBaseNumber System
2Binary13Tridecimal32Duotrigesimal
3Ternary14Tetradecimal33Trtritrigesimal
4Quaternary15Pentadecimal36Hexatrigesimal
5Quinary16Hexadecimal52Duoquinquagesimal
6Senary20Vigesimal56Hexaquinquagesimal
7Heptary23Trivigesimal57Heptaquinquagesimal
8Octal24Tetravigesimal58Octoquinquagesimal
9Nonary [Ref 3.]26Hexavigesimal60Sexagesimal
10Decimal27Heptavigesimal61Unsexagesimal
11Undecimal30Trigesimal62Duosexagesimal
12Duodecimal

References

  1. Standard positional number systems

  2. Positional number systems

  3. Positional base conversion

  4. Base

  5. Table of bases 2..36 for decimal values 0..256

  6. Radix

  7. List of numeral systems

  8. Simple conversion algorithms

Number::More v0.2.1

Provides number base transform functions

Authors

  • Tom Browder

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Number::More

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.