Computer science: what is 0x (hex notation)?

Tutoring math and computer science, you see hex occasionally. The tutor mentions it.

A number like 0x76 or 0xea means it’s hex notation, or base 16. Therefore, 0x76 doesn’t mean 76; it actually means 7×161 + 6×160, or 118. Since hex needs single digits to represent numbers as high as 15, a means 10, b means 11,…f means 15.

It seems to me I used to see hex more often, ten or fifteen years ago, than I do now. Mac addresses seem to still use it, and assembly language did (does). Some color descriptions still use it as well: for instance, #ff0000 is red in html (or css).

Source:

mozilla.org

indiana university

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply