Hexadecimal

From Hackepedia
Jump to navigationJump to search

If we had 8 fingers on each hand we'd likely have a hexadecimal system. Hexadecimal is BASE 16 compared to decimal which is BASE 10.

Decimal              Hexadecimal
1                               1
2                               2 
3                               3
4                               4
5                               5
6                               6
7                               7
8                               8
9                               9
10                             A
11                             B
12                             C
13                             D
14                             E
15                             F
16                             10

Some well known hexadecimal numbers are:

  • 0xFFFFFFFF limit of 32 bit unsinged integer
  • 0xFFFFFFFFFFFFFFFF limit of 64 bit unsigned integer
  • 0xDEADBEEF a magic number used in UNIX's memory
  • 0xCAFEBABE a magic number used in Java

In the C programming language a hexadecimal number is always prepended with a 0x, as in 0x1, 0x2, 0x4 and so on...