Where does 0x come from?

Possible duplicate:
Why is the hex prefix like 0x?

I just saw a comment made by my friend:

3x12=36 2x12=24 1x12=12 0x12=18 

What made me think ..
Why did they choose 0x as a prefix for hexadecimal numbers? Is there any story behind this decision?

+5
source share
4 answers

I think because x comes from hex and 0 means that it is a number.

+4
source

0x means the number is probably hexadecimal. This applies to C / C ++ and languages.

His comment is a joke. it starts with multiplication tables for the number 12, but when it comes to 0, it implies that 0x not "0 times ...", but instead is hexadecimal, so 12 in hexadecimal is equal to 18 in decimal form.

+1
source

This is a joke on HEX numbers from WIKIPEDIA .

The first three are interpreted as multiplication, but in the latter case, the “0x” signal has a hexadecimal interpretation of 12, which is 18.

0
source

'0x' means that the number that follows is in hexadecimal format. This is a way to unambiguously indicate that a number is in hexadecimal and is a designation recognized by C compilers and some assemblers

0
source

Source: https://habr.com/ru/post/901737/


All Articles