Balanced ternary: Difference between revisions

(/* {{header|jq)
Line 3,406:
end
end
| sub("^00*";"")
| if . == "" then "0" end
end ;
 
Line 3,427 ⟶ 3,428:
def new:
if type == "string" and all(chars; IN("0", "+", "-"))
then sub("^00*"; "") | if . == "" then "0" end
elif type == "number" and trunc == .
then toBT
2,502

edits