RosettaCodeData/Task/Loops-While/PostScript/loops-while.ps

10 lines
185 B
PostScript
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
1024
{
dup 0 le % check whether still greater than 0
{ pop exit } % if not, exit the loop
if
dup = % print the number
2 idiv % divide by two
}
loop