Tutorials

 Reply to this postStart new topic

Hex to Decimal, Decimal to Hex

Mora Hannover
post Jan 15 2015, 08:49 PM
Post #1


Ameteur Member

Posts: 42
Joined: 3-November 14



We all now Decimal is the normal 10 numbers.
0,1,2,3,4,5,6,7,8,9
so the base of Decimal is 10
eg: (42)10

Hex consists of the normal 10 numbers and the First 6 Alphabetics
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
A=10
B=11
C=12
D=13
E=14
F=15
The Base of Hex is 16
eg: (0x4B)16

now lets convert 1128 to Hex
divide 1128 by 16
-1128 divided by 16 is 70.5. So the integer division result is 70
-Ignore the point.
-The remainder is (70.5 - 70) multiplied with 16; or (0.5 times 16), which is 8.
Write 8 in your notepad,paper,book,leaf or bones.

Repeat the same step until you reach 0
now collect the remainders from bottom to top order.
The answer would be 468
now add 0x before the number
here is the final answer
CODE
0x468


now lets convert 256 to Decimal
Little Bit hard. The best explanation is here http://www.permadi.com/tutorial/numHexToDec/
When you start converting to decimal
you should remove 0x
So
from
CODE
0x256


to

CODE
256


Using in GTA SA
you can use this method
in many memory addresses
for example RGBA. R is 255. You can't change the memory with a decimal. It should be converted to hex.

I hope the tutorial was helpfull


--------------------
Rest in Peace Yeardley Diamond (Dec. 21, 1985 - Aug. 20, 2014)
Rest in Peace Kitty0706 (1994 - Jan. 25, 2015)
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members: