$\require{cancel}$
Arbitrary Base Conversion
- There is very little to discuss here.
- In a positive integer base n
- There are n digits $\{ 0, 1, 2, 3, ..., n-1\}$
- If n > 10, we start to use letters.
- For base 11, we use 0-9 + a
- For base 16 we use 0-0 + a-f
- No digit will ever be equal to n.
- The radix for base n is n
- For bases other than 10, subscript the number with the radix or base to indicate the base it is in.
- While it is possible to convert directly between any two bases
- You need to be able to divide in an arbitrary base.
- And I can't do that.
- So I convert everything to base 10.
- Take a look at BaseN.cpp