Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lotd76718yLol.
Can't come up with anything where that's a good solution.
Unless it's on very low resources.. -
Player221238y@lotd yeah, it's what @sylflo said. If the point of the program isn't to generate them it is much quicker to hardcode them then to calculate them. -
CptFox15788y@apisarenco do you need the whole list ? Because if you just need to generate random big primes, the Miller-Rabin test is your friend. Sure, it's probabilistic, but it's really fast and accurate enough that for very big numbers, you're more likely to get a wrong prime with the deterministic version due to EM caused error than to get a wrong one from the probabilistic one. Look it up if you haven't heard of it, pretty useful :) -
CptFox15788y@apisarenco Well, Miller-Rabin can still be used, it is fast and reliable enough that you could just use it on every non-5-ending odd number and still iterate faster than the trivial prime generation anyways. Although I have mostly used it on huge numbers where trivial generation doesn't even apply. Maybe I should have a look at that project Euler thing. Heavy prime number usage can only mean fun.
Related Rants

It changed my life, really. 😁
I hope they used a program to generate that as output!
undefined
code
github
c++
prime numbers