*** Welcome to piglix ***

Base16


In mathematics and computing, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a, b, c, d, e, f) to represent values ten to fifteen.

Hexadecimal numerals are widely used by computer system designers and programmers. As each hexadecimal digit represents four binary digits (bits), it allows a more human-friendly representation of binary-coded values. One hexadecimal digit represents a nibble (4 bits), which is half of an octet or byte (8 bits). For example, a single byte can have values ranging from 00000000 to 11111111 in binary form, but this may be more conveniently represented as 00 to FF in hexadecimal.

In a non-programming context, a subscript is typically used to give the radix, for example the decimal value 10,995 would be expressed in hexadecimal as 2AF316. Several notations are used to support hexadecimal representation of constants in programming languages, usually involving a prefix or suffix. The prefix "0x" is used in C and related languages, where this value might be denoted as 0x2AF3.

In contexts where the base is not clear, hexadecimal numbers can be ambiguous and confused with numbers expressed in other bases. There are several conventions for expressing values unambiguously. A numerical subscript (itself written in decimal) can give the base explicitly: 15910 is decimal 159; 15916 is hexadecimal 159, which is equal to 34510. Some authors prefer a text subscript, such as 159decimal and 159hex, or 159d and 159h.

In linear text systems, such as those used in most computer programming environments, a variety of methods have arisen:


...
Wikipedia

...