Balanced ternary: Difference between revisions

Content added Content deleted
Line 30: Line 30:


<syntaxhighlight lang="11l">T BalancedTernary
<syntaxhighlight lang="11l">T BalancedTernary
:str2dig = [‘+’ = 1, ‘-’ = -1, ‘0’ = 0]
-:str2dig = [‘+’ = 1, ‘-’ = -1, ‘0’ = 0]
:dig2str = [1 = ‘+’, -1 = ‘-’, 0 = ‘0’]
-:dig2str = [1 = ‘+’, -1 = ‘-’, 0 = ‘0’]
:table = [(0, -1), (1, -1), (-1, 0), (0, 0), (1, 0), (-1, 1), (0, 1)]
-:table = [(0, -1), (1, -1), (-1, 0), (0, 0), (1, 0), (-1, 1), (0, 1)]


[Int] digits
[Int] digits