Re:Is This Prime?
by W0lf on Friday July 16, 2021 @09:52AM
(#27856221)
I am not doing _that_ type of number crunching in my daily work, so the following check (in Python) has probably lots of potential for improvement:
[ Parent
| on HN ]
Re:Is This Prime?
by PirateAvogadro on Friday July 16, 2021 @10:49AM
(#27856806)
You don't need to test up to n/2, just floor(sqrt(n)) will do
even better you only need to test the primes <= floor(sqrt(n))