On Mon, Sep 24, 2012 at 10:09 AM, Richard Nuttall
<richard.nutt...@pirum.com> wrote:
> A quick search throws up http://primes.utm.edu/prove/prove2_3.html
>
> Which says that for/n/< 341,550,071,728,321 it is enough to test 2, 3, 5, 7,
> 11, 13 and 17 to be definitive (and fewer specific tries for smaller n)
>
> That also verifies the 75/25 figures mentioned below.
>
> So, depending on the implementation, the documentation should be able to be
> explicit about how accurate it is.

Niecza's implementation of is-prime already takes advantage of this,
and my understanding of Rakudo's implementation is that it always
tests against the first 256 primes, so it also takes advantage of this
in correctness, if possibly not in speed.

-- 
Solomon Foster: colo...@gmail.com
HarmonyWare, Inc: http://www.harmonyware.com

Reply via email to