RosettaCodeData/Task/Van-der-Corput-sequence/PL-I/van-der-corput-sequence.pli
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

18 lines
432 B
Text

vdcb: procedure (an) returns (bit (31)); /* 6 July 2012 */
declare an fixed binary (31);
declare (n, i) fixed binary (31);
declare v bit (31) varying;
n = an; v = ''b;
do i = 1 by 1 while (n > 0);
if iand(n, 1) = 1 then v = v || '1'b; else v = v || '0'b;
n = isrl(n, 1);
end;
return (v);
end vdcb;
declare i fixed binary (31);
do i = 0 to 10;
put skip list ('0.' || vdcb(i));
end;