What does 0X mean?

what does 0X mean? I saw this in class, but my teacher did not know either. Is it synonymous with hexadecimal or does it mean all meanings? Thanks for the help guys!

+6
source share
4 answers

Yes, this means the following hexadecimal value:

var num = 0xFF; //255 - 1111 1111 
+11
source

This means that subsequent characters in the token should be interpreted as heXadecimal

 0x20 

means decimal value

 32 
+5
source

0x is how you designate a hexadecimal string in JavaScript, for example. 0xFFFFFF

+2
source

Yes, this means that the value that comes after "0x" is interpreted as a hexadecimal value.

 var a = 0x123; console.log(a); // output is ((16^2)*1) + ((16^1)*2) + ((16^0)*3) = 291 

See also What do numbers mean using 0x notation

Hope this helps.

+2
source

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


All Articles