Primes 1.0 25/8/96 Thorsteinn Sveinsson Requierments: An Amiga with OS 2.0+ and 68000 or better will do. I did this primarily to test the speed of my 060 :-) It was compiled whith the ADE C compiler, as it doesn't support the 68060 yet it was compiled for the 040 and lower CPU's. It has some switches, type primes ? to see them. A short explenation of the switches follows: N=Number/K/N,S=Start/K/N,E=End/K/N,P=Print/S N = 10000, or N 10000 will compute the first 10000 primes, that is from 0 to howerer high it has to go to get 10000 primes. S = from which number to start finding primes, default 0. E = upto which number to compute primes, default S + 100000. P = whether to print the prime numbers, default is off. The switches can be combined any way you want. Default is to compute primes between 0 and 100000. Examples: 1) >primes s 100000 e 200000 will find all the prime numbers between 100000 and 200000 (not including the start and endnumbers) 2) >primes n 100000 p >primenumbers Will compute the first 100000 prime numbers and redirects the output to a file named primenumbers. 3) >primes s 100000 n 10000 Will find 10000 primes from 100000 to however high it has to go to get them. This is an example run on my setup: 8.0.Ram Disk> primes040fpu n 10000 Now computing 10000 primes You can interrupt at any time with ctrl-c Thats it! Found 10000 prime numbers between 0 and 104725 in approximately 1 seconds I'm not sure it could be made to run any faster with code optimized for the 060. The source is included, do not look at it as a good example of how to program, Im sure it can be done better/faster/whatever, do whith it what you want. I can be reached at ths@arch.kth.se, oh and have a peek at my Homepage -> HTTP://www.arch.kth.se/~ths. PS. I compiled a variant of this program with BC4.5 on a p120 winnt box, just had to see if it would be much faster, to my surprise it was in fact slightly slower on the PC, takes about 3 secs for the default settings. And yes, it was optimized for the pentium :-).