Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does 0X mean? [duplicate]

Tags:

javascript

what does 0X mean? I saw it mentioned in class, but my teacher had no idea either. Is it synonymous to the word hexadecimal or does it mean all values? Thanks for your help guys!

like image 338
Moraki Avatar asked Nov 17 '11 18:11

Moraki


People also ask

What does 0x stand for?

The prefix 0x is used in code to indicate that the number is being written in hex. But what is 'B' doing in there? The hexadecimal format has a base of 16, which means that each digit can represent up to 16 different values.

What does 0x mean in assembly language?

0x is hexadecimal (base 16). Without the 0x you get decimal (base 10).

What does 0x mean in memory?

The 0x is just a notation to let you know the number is in hexadecimal form. Same as you'd write 042 for an octal number, or 42 for a decimal one.

What does the 0x stand for in hex?

Hexadecimal is the base-16 number system, as opposed to the base 2 system (binary) and base 10 system (decimal). The prefix we use for hexadecimal is "0x". To represent the numbers 0-9, we simply use those digits.


2 Answers

Yes, it means the following value is in hexadecimal:

var num = 0xFF; //255  -  1111 1111
like image 164
Nick Rolando Avatar answered Oct 23 '22 13:10

Nick Rolando


It means the subsequent characters in the token should be interpreted as heXadecimal

0x20

means the decimal value

32
like image 28
McKay Avatar answered Oct 23 '22 11:10

McKay