On Sun, 12 Sep 2010, Frank Barknecht wrote:
On Sat, Sep 11, 2010 at 10:48:05PM +0100, Pedro Lopes wrote:
other way to go: you could grab them from a file (of stored primes) or from an online prime generator =P
Actually that's what I would do. And did, see attachment. The numbers come from http://primes.utm.edu/lists/small/1000.txt They are included twice to allow random and sequential access to the first 1000 primes.
Also, because the 1000th prime is 7919 and because 7919*7919 = 62710561 >= 16777216, then that list of primes is enough for anything you can do with pd's normal floats. It can even be said that you only would ever need the first 574 primes when using the float format to represent whole numbers : the 574th prime is the biggest prime you'll need to figure out that any bigger float is a prime number, up to the limit where whole odd floats stop to exist. It's because it's the last prime before 4096, and 4096*4096 = the limit itself.
| Mathieu Bouchard ------------------------------ Villeray, Montréal, QC