*** Welcome to piglix ***

Balanced ternary


Balanced ternary is a non-standard positional numeral system (a balanced form), useful for comparison logic. While it is a ternary (base 3) number system, in the standard (unbalanced) ternary system, digits have values 0, 1 and 2. The digits in the balanced ternary system have values −1, 0, and 1.

Different sources use different glyphs used to represent the three digits in balanced ternary. In this article, T (which resembles a ligature of the minus sign and 1) represents −1, while 0 and 1 represent themselves. Other conventions include using '−' and '+' to represent −1 and 1 respectively, or using Greek letter theta (Θ), which resembles a minus sign in a circle, to represent −1.

In Setun printings, −1 is represented as overturned 1: "1".

In the early days of computing, a few experimental Soviet computers were built with balanced ternary instead of binary, the most famous being the Setun, built by Nikolay Brusentsov and Sergei Sobolev. The notation has a number of computational advantages over regular binary. Particularly, the plus–minus consistency cuts down the carry rate in multi-digit multiplication, and the rounding–truncation equivalence cuts down the carry rate in rounding on fractions.

Balanced ternary also has a number of computational advantages over traditional ternary. Particularly, the one-digit multiplication table has no carries in balanced ternary, and the addition table has only two symmetric carries instead of three.

A possible use of balanced ternary is to represent if a list of values in a list is less than, equal to, or greater than the corresponding value in a second list. Balanced ternary can also represent all integers without using a separate minus sign; the value of the leading non-zero digit of a number has the sign of the number itself.


...
Wikipedia

...