954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

didn't understand these numbers

Hi everybody,
First, i posted this here because i don't know what this is.
Numbers like these : 0x000 0x010 0x011 0x040 0x0C1 0x200 0x181
What are they ?
binary ?
Thanks

Karlwakim
Junior Poster in Training
89 posts since Dec 2011
Reputation Points: 27
Solved Threads: 2
 

They're hexadecimal. 0x is a common prefix for hexadecimal. You'll also see a suffix of h. But the telltale sign is letters.

deceptikon
Indubitably
Administrator
632 posts since Jan 2012
Reputation Points: 119
Solved Threads: 105
 

If you have computer with Python you can have it show the binary and decimal versions easily:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

>>> for a in 0x000, 0x010, 0x011, 0x040, 0x0C1, 0x200, 0x181:
	print "{0:024b} {0:03x} {0:04}".format(a)

	
000000000000000000000000 000 0000
000000000000000000010000 010 0016
000000000000000000010001 011 0017
000000000000000001000000 040 0064
000000000000000011000001 0c1 0193
000000000000001000000000 200 0512
000000000000000110000001 181 0385
pyTony
pyMod
Moderator
5,358 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
 

Ok thanks !
But when i write them in a hex editor, i get only dots

Karlwakim
Junior Poster in Training
89 posts since Dec 2011
Reputation Points: 27
Solved Threads: 2
 

That's because values like 0x0001 and 0x012 are not printable characters.

See this . Printable character are basically 0x0020 to 0x007E.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Ok that was helpful

Karlwakim
Junior Poster in Training
89 posts since Dec 2011
Reputation Points: 27
Solved Threads: 2
 

You can use calc in windows, when you set it up to scientific view, then click on the button to set it to hex (Hexadecimal) mode, then you can type these numbers, ignoring 0x and any preceding zeroes starting with the first numbre different to zero, change setting to Centesimal mode and see how the numbre you typed changes to it's decimal value.

jacklogan
Newbie Poster
3 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You