For example, Don Knuth's favorite base, signed ternary. Vanilla ternary uses the digits 0,1, and 2. Signed ternary doesn't need the 2, so recycle it as -1. Seems wierd, but counting somehow becomes more natural:

Code: Select all

```
decimal : 0 1 2 3 4 5
signed ternary : 0 1 12 10 11 22
```

Code: Select all

```
Vanilla Ternary Signed Ternary | Vanilla Ternary Signed Ternary
--------------- --------------- | --------------- ---------------
| 1 1
11 11 | +1 +1
+2 +2 | ---- ----
-- ---- | 2 no carry 12 carry 1
0 carry 1 0 no carry |
2 1 |
--- ---- |
20 10 |
```

I've only found one drawback to this technique, but it is a biggie: we already have a hard-wired meaning for the symbol "2", and it does take some time to get used to it. However, this is a general problem when going to a different base. After all, these strings:

Code: Select all

```
10
1/2
3.1415926
```

1. You don't have to come up with new symbols for the negative digits.

2. Addition/subtraction tables are the same, except instead of carrying when rolling over from b-1 to 0, you carry when you roll over from floor(b/2) to floor(b/2)+1.

2. It reveals the connection between signed arithmetic and complement arithmetic.

Another thing I should point out is that for even bases, this doesn't yield a balanced arithmetic. Whether you consider this a drawback or not, YMMV, but I actually like it, because it *does* yield a signed arithmetic for that base which does not have ambiguous digit representation. I'll illustrate with senary:

Vanilla senary uses the digits 0,1,2,3,4,5 as per normal. Signed senary uses the digits 0,1,2,3 as per normal, but 4 <-> -2 and 5 <-> -1. There is no symbol for -3.

This means that even though every positive and negative integer can be uniquely represented, its not absolutely trivial to negate a number in all cases, just by swapping out each digit for its corresponding opposite-signed digit. For example, senary 124 can be negated just by swapping digits to 542. But the negation of 3 is 53. With practice though negating isn't hard at all. Just whenever you see a 3, you need to add "53" to the number you are constructing. e.g.:

Code: Select all

```
5 * 1203 = 5000 (5 is the opposite digit to 1)
+ 400 (4 is the opposite digit to 2)
+ 0
+ 53 (53 is negative three)
-----
5453
```