Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: apcalc on February 22, 2011, 05:25:15 pm

Title: Changing the Base of Numbers
Post by: apcalc on February 22, 2011, 05:25:15 pm
I was wondering:  does anyone here know an extremely rapid/simple way to change the base of a number (by hand, not through a program :P)?  I have used methods I read about on the Internet, but none of them are very fast for me to do.  I always come across new ways to do things like this by hand, but I can't seem to find one for changing bases.  Does anyone know of a way to do this?  Thanks! :)
Title: Re: Changing the Base of Numbers
Post by: Xeda112358 on February 22, 2011, 05:36:45 pm
Oh, yes, that is rather easy/fun. All you do is use mod values and you don't even need to know what that means!
Basically you do X/A and you take the whole part and the remainder. A is your base. so if you do x=117 and A=10 you get 11 and 7. 7 is the last digit. So:

117→q
117/10: q=11 7=r
11/10 : q=1  1=r
1/10  : q=0  1=r

so your number is 117 in base 10 (go figure). Now for base 16:
117/16: q=7  5=r
7/16  : q=0  7=r

so in hex, 117 is 75h


Just remember that after 9 you start to use letters starting at A.
Title: Re: Changing the Base of Numbers
Post by: leafy on February 22, 2011, 06:02:42 pm
The way I like doing it is:
start with any number (1337_10)

Divide by the base you're calculating into (in this case, hex):
1337|16==>83r9
83|16==>5r3
5|16==>r5

Until you no longer have anything except for a remainder. Then read the remainders backwards.
539...easy?