[squeak-dev] Integer>>isPrime why reverting Knuth's algorithm P (probabilistic primality test) with iteration over division with even numbers?

Enrico Spinielli enrico.spinielli at googlemail.com
Fri Dec 18 16:25:45 UTC 2009


Hi all,
I am back to checking Squeak after quite a while and got latest trunk.
I looked after one of my contributions Integer>>isPrime
and I found my implementation of Algorithm P from Knuth's AOCP vol 2
substituted by an iteration of dividing self by all even numbers starting
from 3
and (correctly) stopping at self sqrtFloor.
This is IMHO a questionable/useless "improvement", not even looking to try
to implement the Sieve of Eratostene...!

Again IMHO isPrime should be reverted back to what has been renamed
isProbablyPrime

Not being anymore used to contribute I just signal it here...

Hope it helps
Bye
-- 
Enrico Spinielli
"Do Androids dream of electric sheep?"— Philip K. Dick
"Hear and forget; see and remember;do and understand."—Mitchel Resnick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20091218/2aa92b2f/attachment.htm


More information about the Squeak-dev mailing list