Earlier quoted context omitted.
Try solving some Project Euler problems. You'll see the win pretty quickly when you have to search a large range for primes.
Why would that be true?
My favorite prime number generator
61–70 of 88 posts
Re: My favorite prime number generator
#62Can I just say how surprised I am the many people have a favourite prime number generator. I can’t say I have a favourite but I do enjoy multiplying two random prime numbers with each other and using the random result when I need a random number with added random.
To add maximum random, sometimes I like to return a string with a random Gertrude Stein quote, segfault, or make the PC speaker beep instead of returning a number. So random!
Re: My favorite prime number generator
#63What are you using your prime numbers for?
Re: My favorite prime number generator
#64Earlier quoted context omitted.
Why would that be true?
The list you need to process is large enough that it would be prohibitive to put it all in memory at once. Furthermore you do not start knowing things like how many primes to look at. Therefore generating and dealing with them iteratively makes for simple code and a lot fewer headaches.
Re: My favorite prime number generator
#65Earlier quoted context omitted.
Why would that be true?
The list you need to process is large enough that it would be prohibitive to put it all in memory at once. Furthermore you do not start knowing things like how many primes to look at. Therefore generating and dealing with them iteratively makes for simple code and a lot fewer headaches.
I'd say the flexibility to not need to know how big of a prime you'll need is the main draw.
Re: My favorite prime number generator
#66Re: My favorite prime number generator
#67My favorite prime number generator is ┬─┬───────────────────────────────────┬──── ────┬ │ │ ┬─┬ ────┬─┬────────────────────── ┼───┬ ┬───┼ │ │ └─┤ ────┼─┼───────────────────┬── ┼───┼ │ ┬ │ │ │ │ ┬───┼─┼───────────────────┼── ┼─┬─┼ │ ┼ │ │ │ │ │ ─ ┼─┼─┬─────┬──── ──────┼─┬ │ ├─┘ └─┤ │ │ │ │ │ ┬ └─┤ │ ┬─┬ ┼─┬─┬ ──┬───┼─┼ ├─┘ ├─┘ │ │ │ └─┤ └─┤ └─┤ │ ├─┘ ──┼─┬─┼─┼ │ │ │ │ │ │ │ │ ├─┘ ┬─┼─┼─┼─┼ │ │ │ │ │ │ │ ├─┘ └─┤ │ ├─┘…
Super cool to see one of the authors of the most popular Go scoring methods (particularly for MCTS) posting here :) Respect and thanks!