All topics

s3.2.1

Converting Integers

1,000 questions

This section covers the two main processes for converting integers between bases.

Base-n to Base-10: To convert a number from base-n to base-10, you expand it as a sum of powers of n. For example, 1236=1×62+2×61+3×60=36+12+3=5110123_6 = 1 \times 6^2 + 2 \times 6^1 + 3 \times 6^0 = 36 + 12 + 3 = 51_{10}.

Base-10 to Base-n: To convert from base-10 to base-n, you repeatedly divide the number by the highest possible power of n, recording the quotient as a digit and using the remainder for the next step with the next lower power of n. For example, to convert 511051_{10} to base-6, the highest power of 6 that divides it is 62=366^2=36. 51÷36=151 \div 36 = 1 with a remainder of 15. The next digit is 15÷6=215 \div 6 = 2 with a remainder of 3. The last digit is 3÷1=33 \div 1 = 3. So, 5110=123651_{10} = 123_6.

Practise this