It's a problem of you not thinking in hex
Hex is not a variable type, it's just a way o represent a value. Like in languages one, un, Uno, ein, één etc mean the same thing in different languages. The 0x in front tells the compiler (and you) it's hex. And hex does not roll over after 9
It rolls over after F. So 0x8 + 0x4 = 0xC and 0xC + 0x2 = 0x8 + 0x4 + 0x = 0xE, not 0x14 ![]()
0x10 + 0x4 = 0x14 but in decimal it's 16 + 4 = 20