Balanced ternary: Difference between revisions

m (→‎{{header|Perl 6}}: various fixes)
Line 2,119:
 
zeroTrim a = if null s then [0] else s where
s = fst $ foldl f ([] ,[]) a
f (x,y) _ []0 = (x, y++[0])
f (x ,y (0:zs) z = f x (x++y++[0z]), zs[])
f x y (z:zs) = f (x++y++[z]) [] zs
 
btList (Bt a) = a
Anonymous user