Re: Sequence items to a single number ? How to achieve ?
- Posted by evanmars Feb 04, 2011
- 1398 views
try this
include std/math.e integer d = 5 --your decimal number sequence b = {} while 1 do b = append(b,mod(d,2)) d = floor(d/2) if d = 0 then exit end if end while puts(1,"{") for i = 1 to length(b) do printf(1,"%d",b[i]) if i != length(b) then puts(1,",") end if end for puts(1,"}")