Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Decimal & Hexidecimal
Decimal & Hexidecimal
2002-07-19, 9:21 PM #1
I've made it halfway through the tutorial of hexidecimal/decimal code at Millennium. What is stopping me is understanding. I need to understand before I go on further. The tutorial says that decimal 10 is integers 0-9. It then displays the numbers 10-30 missing the number 19 on the decimal chart. My question is this. Did the author of the tutorial goof and left out integer 19, or is there a better reason of why this was done and decimal 10 code can't be a one column number like 1 or 2?
2002-07-19, 9:27 PM #2
Going with what I believe is true, I tried to follow the hexidecimal adding and subtracting. Someone this just doesn't seem to make sense, and I find the tutorial hard to follow in what he/she is trying to explain.

I'm not seeing this clearly.

0x1a0 + 0xabc = 0xc5c

0xdf8 - 0x9c9 = 0x42f
2002-07-20, 3:52 AM #3
Blah. Window's caslculator does great conversions between number formats.

1) Open Calc.
2) Set it to the type of number you have, and need to convert.
3) Type in your number.
4) Set it to the type of number you need to convert it to.
5) The resulting number is the conversion.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-07-20, 4:16 AM #4
*nods head* I agree with GBK, type in 19 and it come out. 0x13 . To convert a hex to a decimal, take each number and times it by 16 to the x power, where x is its 'place value'. For example, 0x213 = (2*16^[2]) + (1*16^[1]) + (3*16^[0]) = 512 + 16 + 3 = 531 in decimal the [] is the x. If you still don't follow what I'm saying, please speak or die.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-20, 8:53 PM #5
Sorry, it may not have been clear for you, I'll try to help anything you don't understand here.

That chart is the conversion of decimal into hexadicimal.

From 0 to 9, it's the same on hexadecimal, but decimal 10 will be displayed as "a" for hexadecimal and "b" for 11 and so on.

I left out 19 to 24, because that just is the same pattern.

1 and 2 in decimal is 1 and 2 in hexadecimal, that's what the first line of the chart means.

I'll explain you the calculation of hexadecimal numbers you brought up.

Just as in decimal, you add up from the lowest digit.

0x1a0 + 0xabc ->
0 + c is c. So the lowest digit remains as "c".
a + b is 15. Note "15" is in hexadecimal.(a is 10 in deci, b is 11 in deci. 10 in hex is 16 and 5 in hex is 5) So this digit gives 1 on the upper digit and will have 5 as its own digit.

1 + a is b. But the lower digit gave 1, so b + 1 is c and this digit becomes c.

So, c -> 5 -> c. 0xc5c.

Hope this makes sense to you.

------------------
http://millennium.massassi.net - Millennium
JK Mods : Sniper Arena! - Enhancement Pack!

↑ Up to the top!