RosettaCodeData/Task/Loops-While/Forth/loops-while.fth

6 lines
87 B
Forth

: halving ( n -- )
begin dup 0 >
while cr dup . 2/
repeat drop ;
1024 halving