hexadecimal


A hexadecimal is a number that has a base of 16. This means that each place value can have a maximum value of 15. Letters A through F represent the decimal numbers 11-15 in alphabetical order. This is useful because a byte can be represented as exactly two characters in hexadecimal, and the bit pattern a number represents can be deduced more easily. To designate that a number is hexadecimal, in many computer languages, 0x is prepended to the number. For example, 0x12F3 denotes the hexadecimal number 12F3, or in decimal, 3 + 15*16 + 2*256 + 1*4096 = 4851. (In mathematical contexts base is usually designated with a subscript.) In Scheme, a hexadecimal is represented by the number having an #x in front of it. For example

 (+ #x123 #xff) 
 ;; This evaluates to 546