That is exactly the point. Testing for primality these days is for things like encryption<div>which works best for large integers.</div><div>I think a lot of this thread is about a misunderstanding of &#39;probabilistic method&#39;</div>
<div>in fact the probability is made so low that other factors, i.e. cosmic radiation,</div><div>could factor in and mess things up, i.e. a bit of your computer memory...now</div><div>I do not see any evidence that we try to avoid the effects of cosmic</div>
<div>radiation, then I do not see why we should dismiss the primality testing</div><div>algorithm as &#39;non deterministic&#39;...</div><div><br></div><div>The suggestion for Randal is fine for me, as anything else you want to do,</div>
<div>even keep current isPrime</div><div><br></div><div>Bye</div><div>Enrico<br><br><div class="gmail_quote">On Tue, Dec 29, 2009 at 1:31 PM, Juan Vuletich <span dir="ltr">&lt;<a href="mailto:juan@jvuletich.org">juan@jvuletich.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Enrico Spinielli wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
I just reply with the words of SICP, footnote 47 in the link below:<br>
In testing primality of very large numbers chosen at random, the chance of stumbling upon a value that fools the Fermat test is less than the chance that cosmic radiation will cause the computer to make an error in carrying out a ``correct&#39;&#39; algorithm. Considering an algorithm to be inadequate for the first reason but not for the second illustrates the difference between mathematics and engineering.<br>

<br>
Bye<br>
Enrico<br>
<br>
</blockquote>
<br></div>
Hi.<br>
<br>
That&#39;s assuming that you&#39;re testing very large numbers chosen at random. That&#39;s not always the case! And also assuming that the computer is not fail-proof. For example, a typical setup for critical applications is to have 3 computers do the same calculation, and vote on the correct result.<br>

<br>
A routine should not assume much about how it is going to be used. Instead, it should make clear its assumptions and limitations so callers will know. #isProbablyPrime or such, and a method comment with exactly the text you quote is the best.<br>

<br>
Cheers,<br><font color="#888888">
Juan Vuletich<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Enrico Spinielli<br>&quot;Do Androids dream of electric sheep?&quot;— Philip K. Dick<br>&quot;Hear and forget; see and remember;do and understand.&quot;—Mitchel Resnick<br>

</div>