Hexadecimal

Hexadecimal is a positional numeral system with a radix (or "base") of 16.

Hexadecimal is widely used in the computer sciences and a hexadecimal number is usually distinguished from a decimal number by the prefix 0x (in GM the dollar-sign ($) is used). So for instance 0xB is equal to the decimal number 11 and the number 0x10 is equal to 16.

To convert a hexidecimal number to a decimal number you can follow this formula:

dec=val[n-1]*power(16,n-1) + val[n-2]*power(16,n-2) + ... + val[1]*power(16,1) + val[0]*power(16,0);

Where n is the number of digits in the hexadecimal number and val[n] is the value of the nth digit from the right (9 has value 9; A has value 10; B has value 11; etc.) So following this formula the decimal value of the number 0xABC would be:

dec=10*power(16,2) + 11*power(16,1) + 12*power(16,0) = 2560 + 176 + 12 = 2748