www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Is prime missing in photos?

reply Andre Pany <andre s-e-a-p.de> writes:
Does Phobos have an isPrime function? I cannot find it in the 
library. I currently have a look at projecteuler.net problem no 
7. Such a function makes it a lot easier to solve the problem.


Kind regards
Sep 29 2017
parent Elronnd <elronnd em.slashem.me> writes:
Well the purpose of the exercise kind of *is* to write a prime 
number generator.  You can look up prime number sieves and 
algorithms.  For REALLY large numbers, that takes an insane 
amount of time, and you can instead use algorithms such as the 
ones outlined at 
ents/fips_186-3.pdf (appendix C.3)
Sep 29 2017