Sieve of Eratosthenes: Difference between revisions

m
Line 1,656:
</lang>
====2i wheel emulation of Sinclair ZX81 BASIC====
Backward-compatible also on Spectrums, (as well as 1K ZX81s for all primes < Z=441). N.B. line 40 adds a <code>STEP</code> of 2 to mitigate line 50's inefficiency when going to 90. <lang qbasic>
10 INPUT Z
15 LET L=SQR(Z)
Line 1,673:
130 NEXT I
</lang>
 
====2i wheel emulation of Sinclair ZX80 BASIC====
. . . with 2:1 compression (of 16-bit integer variables on ZX80s) such that it obviates having to cross out higher multiples of 2; one has to input odd upper limits on factors to be squared, L (=21 at most on 1K ZX80s for all primes till 439).<lang qbasic>