A hexadecimal number is a number written in the hexadecimal number system. Hexadecimal numbers are used in low-level programming rather than decimal numbers because they are closely related to binary numbers —- the only numbers used by computers. Since the base of hexadecimal numbers is 16 (a power of 2), it is easy for a computer to convert hexadecimal numbers into binary.
Hexadecimal numbers are more common than binary numbers or octal numbers in programming because they are more compact than either of them (meaning they take up less space). For example, 255 in decimal is 11111111 in binary, 355 in octal and $ff in hexadecimal.
Common uses of hexadecimal numbers in game programming are referring to memory addresses and defining colors.
There are numerous ways to write hexadecimal numbers. This is a short list :
- $FFFF
- #FFFF
- &hFFFF
- FFFFh
- FFFFH
- 0xFFFF
Related Pages
Links
| Categories: Binary : Data : Math |