-
Posted by 539 on Sun, 19 Oct 2008 22:33:51
I picked up this book today with no background in any languages, including lua. I got to the "Hexadecimal Notation" sextin in Part 1, page 14.
After doing a little research on the internet, i was able to understand your first three examples:
> print(0x1)
> print(0xF)
> print(0x10)
but, alas, I'm confused with the last one.
> print(0x10a4)
I really am looking to understand why the answer is what it is, rather than just knowing the answer. Are there any other sites you would recommend on hexidecimal? or perhaps a thread on the forums?
Thanks,
539
-
Posted by 539 on Sun, 19 Oct 2008 22:33:51
I picked up this book today with no background in any languages, including lua. I got to the "Hexadecimal Notation" sextin in Part 1, page 14.
After doing a little research on the internet, i was able to understand your first three examples:
> print(0x1)
> print(0xF)
> print(0x10)
but, alas, I'm confused with the last one.
> print(0x10a4)
I really am looking to understand why the answer is what it is, rather than just knowing the answer. Are there any other sites you would recommend on hexidecimal? or perhaps a thread on the forums?
Thanks,
539
-
Posted by 539 on Sun, 19 Oct 2008 23:42:48
I figured it out =)
10a4=
1*(16^3) + 0*(16^2) + 10*(16^1) = 4*(16^0) =
4096 + 0 + 160 + 4 =
4260.
(I'm enjoying this much more than any average 21 year old guy should...)
-
Posted by jnwhiteh on Tue, 21 Oct 2008 12:31:23
Great, glad you were able to work it out ;-)