This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,12 @@
trigits=: 1+3 <.@^. 2 * 1&>.@|
trinOfN=: |.@((_1 + ] #: #.&1@] + [) #&3@trigits) :. nOfTrin
nOfTrin=: p.&3 :. trinOfN
trinOfStr=: 0 1 _1 {~ '0+-'&i.@|. :. strOfTrin
strOfTrin=: {&'0+-'@|. :. trinOfStr
carry=: +//.@:(trinOfN"0)^:_
trimLead0=: (}.~ i.&1@:~:&0)&.|.
add=: carry@(+/@,:)
neg=: -
mul=: trimLead0@carry@(+//.@(*/))

View file

@ -0,0 +1,3 @@
a=: trinOfStr '+-0++0+'
b=: trinOfN -436
c=: trinOfStr '+-++-'

View file

@ -0,0 +1,7 @@
nOfTrin&> a;b;c
523 _436 65
strOfTrin a mul b (add -) c
----0+--0++0
nOfTrin a mul b (add -) c
_262023