[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: converting numbers



> Howdy,
> 
> Where's the FM that tells how to convert numbers, like 0x11A to a 
> "decimal"?

0x11A is in hex, and to convert it to dec is
1*16^2 + 1*16^1 +10*16^0
(A=10,B=11, C=12, D=13, E=14, F=15)

I may be wrong, but I think octal is in x0# format, so that 
0x0300 would be an octal number.
To convert that to dec is
just 3*8^2+0*8^1+0*8^0, and ignore the leading 0 after x, which is used to
idenbtify the radix.

Binary...well, is binary.

HTH, 
 Andrew
____________________________________________________________________
Never include a comment that will help | Andrew Ivanov
someone else understand your code.     | c680789@showme.missouri.edu
If they understand it, they don't      | ICQ: 12402354
need you.                              |


Reply to: