Here they are:
Bin(x){ while x r:=1&x r,x>>=1 return r } Dec(x){ b:=StrLen(x),r:=0 loop,parse,x r|=A_LoopField<<--b return r }I tried several different versions, and these are the fastest (and shortest) I could come up with.
If you're interested, I first created some one-liners that do the same thing. Though I must warn that they are both slower and longer: (longer in the number of non-whitespace characters)
Bin(x){ return (x>>1 ? Bin(x>>1):"")x&1 } Dec(x){ return (StrLen(x)>1 ? Dec(SubStr(x,1,-1))<<1:0)|SubStr(x,0) }The fact that they are significantly slower perplexes me. Perhaps it's the overhead of calling itself many times.