in reply to Primes. Again.
Calling it for a somewhat smaller number like 234223345 just makes it run practically forever.# Assigning to negative offset in vec.
EDIT: Never mind, I see the problem. You have to store a bit for each number that could potentially be a prime, so when the max number is extremely large, you apparently go out of bounds. Plus, hits on numbers that have already been punched out increase significantly after the first few primes, and I imagine it would be more efficient to pick some point after which to switch from skip counting to modulo testing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Primes. Again.
by johngg (Canon) on Apr 26, 2006 at 22:35 UTC |