- When we write a positive integer in decimal notation, say 237, we mean that (237)10=2⋅102+3⋅101+7⋅100. This can be written in any base, however, e.g. (237)10=(456)7=(1422)5=(11101101)2=(ED)16.
- The notation extends from integers to positive real numbers by writing further digits (possibly an infinite amount) after a point, as we’re used to with base 10, e.g. (123.456)10=1⋅102+2⋅101+3⋅100+4⋅10−1+5⋅10−2+6⋅10−3.
- As we can see, the pattern for notation is like so: let a number n be denoted by its digits (n1n2n3n4.n5)b in base b. Thus, n=n1⋅b3+n2⋅b2+n3⋅b1+n4⋅b0+n5⋅b−1.
- Converting integers from any base into a decimal is trivial - either by definition, as demonstrated before, or with the following arrangement derived by factorising out the base (to reduce the number of operations):(1422)5=((1⋅5+4)⋅5+2)⋅5+2=(9⋅5+2)⋅5+2=47⋅5+2=237
- There are also tabular arrangements (based on Ruffini’s Rule): Horner’s Method
- Reversing this procedure converts from decimal to any base - keep dividing by the base, ignoring the remainder, e.g. converting 14950 to base 7:
14950=7⋅2135+5
2135=7⋅305+0
305=7⋅43+4
43=7⋅6+1
6=7⋅0+6
- The digits in base 7 are then the remainders, read from the bottom up: (14950)10=(61405)7. Note that this looks similar to the Euclidean algorithm (original note), but it is completely different in terms of the numbers carried forward in each division.
- Extending both parts into the real set of numbers is fairly simple, just first remove any numbers after their point by multiplying/dividing by a number (bn, where b is the base and n is the number of digits after the point), then divide/multiply by the same number after the conversion. If there are infinitely many digits after the point, then just take an approximation.