You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2^24 integers comes out to about 67MB of storage required.
The largest prime number here is 71_378_569.
If you have a bitset with the bits of the prime numbers set up to this value, then this fits into 9MB, and has instantaneous lookup vs. binary search (for checking if a number is prime).
Using core.bitop, you would get both mechanisms to test for prime numbers (and I believe it's an intrinsic), and using BitRange, you get a way to iterate them.
Just food for thought. Could go in a different module in this package.
The text was updated successfully, but these errors were encountered:
2^24 integers comes out to about 67MB of storage required.
The largest prime number here is
71_378_569
.If you have a bitset with the bits of the prime numbers set up to this value, then this fits into 9MB, and has instantaneous lookup vs. binary search (for checking if a number is prime).
Using core.bitop, you would get both mechanisms to test for prime numbers (and I believe it's an intrinsic), and using
BitRange
, you get a way to iterate them.Just food for thought. Could go in a different module in this package.
The text was updated successfully, but these errors were encountered: