Sieve of Eratosthenes: Difference between revisions

m
2 small changes to program (don't affect result); trivial change to header
(Corrected limit in loop to set "composites[c]" to true. Changed "*%" to "*".)
m (2 small changes to program (don't affect result); trivial change to header)
Line 5,484:
The main external change is that the program is not designed to be viewed in the monitor; it just writes as many primes as possible within the limitations imposed by Rosetta Code. Apart from the addition of comments, internal changes include the elimination of one set of masks, and a revised method of switching from one mask to another.
 
On the EDSAC PCEdsacPC simulator (see link above) the printout starts off very slowly, and gradually gets faster.
<lang edsac>
[Sieve of Eratosthenes]
Line 5,524:
 
[Long constants]
T#Z PF TZ [clears sandwich digit between 0 and 1]
[0] PD PF [long value 1; also low word = short 1]
T2#Z PF T2Z [clears sandwich digit between 2 and 3]
[2] PF K4096F [long value 1000...000 binary;
also high word = teleprinter null]
113

edits