Count in octal: Difference between revisions

Content added Content deleted
m (Alphabetize)
(GP)
Line 112: Line 112:
UNTIL num = 0
UNTIL num = 0
END octal.</lang>
END octal.</lang>

=={{header|PARI/GP}}==
Both versions will count essentially forever; the universe will succumb to [[wp:Proton decay|proton decay]] long before the counter rolls over even in the 32-bit version.

Manual:
<lang parigp>oct(n)=n=binary(n);if(#n%3,n=concat([[0,0],[0]][#n%3],n));forstep(i=1,#n,3,print1(4*n[i]+2*n[i+1]+n[i+2]));print;
n=0;while(1,oct(n);n++)</lang>

Automatic:
{{works with|PARI/GP|2.4.3 and above}}
<lang parigp>n=0;while(1,printf("%o\n",n);n++)</lang>


=={{header|Perl 6}}==
=={{header|Perl 6}}==