So, everyone knows and loves positional number systems of different bases. We use base 10 every day, and base 2 if you are a computer, with base 16 as a more compact form that us humans enjoy. Our system of time and measuring circles in degrees uses base 60.
What might happen if you tried to build a positional number system around ? In a positional number system each digit contributes to the value of the number by weighting the base to a power based on the position. The weights are required to be integers less than or equal to the base. Thus:
(437)10 = 4 × 102 + 3 × 101 + 7 × 100
= 400 + 30 + 7
(110101)2 = 1 × 25 + 1 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20
= 32 + 16 + 4 + 1 = (53)10
If the rule is that each weight must be an integer less than the base, then for base , the weightings could either be 1 or 0. For example:
The interesting thing to note is that the even powers act just like base 2, and the odd powers act just like base 2 multiplied by a factor of . Addition is similar to binary addition, except that carries skip adjacent digits and go to the next digit. That is, a carry out in an even position is a carry in to the next most significant even position, and a carry out from an odd position is a carry in to the next most significant odd position.
It would be more convenient to split a base number into a rational part, that is a regular binary number, and an irrational part that is also a regular binary number, but that is multiplied by when computing the value of the number.
Using this representation, any base can be represented as two binary integers. Addition, subtraction, and multiplication are straight forward. For addition, add the real parts and the rational parts separately to get the result. That is, to add two numbers a and b,
where is the rational part of a, is the irrational part of a, is the rational part of b, and is the irrational part of b. Subtraction can be implemented as addition of the inverse.
Multiplication works in the straightforward way:
Division by a purely rational divisor follows the standard rules. Both the rational and irrational parts are divided by the divisor. If the divisor is not purely rational, it can be carried out as follows:
This arithmetic should work for any base where n is an integer. For example, the above addition and multiplication rules are reminiscent of complex arithmetic, as they should be, since .
So, what is this all good for? It is hard to see a use for the general case of base (or even base ). However, base could be useful when dealing with cartesian coordinates and two dimensional maps.
Some games and mapping systems use a movement or planning system where players can move horizontally, vertically, or diagonally. Each move is considered one move, even though a diagonal move is than a horizontal or vertical move, in the interest of avoiding square root calculations. Printed circuit boards are often laid out with traces that are either horizontal, vertical, or at 45 degree angles.
In a mapping or planning system, like one of the above that can only make horizontal, vertical, or diagonal moves, distances between any two points can be computed in base using the above arithmetic with no need for square roots.