[ENH] Integer primality testing

SPINIELLI Enrico enrico.spinielli at eurocontrol.int
Wed Jun 1 11:37:13 UTC 2005


Hi all,
please find attached a changeset which adds primality
testing to Integer.
(I wanted to solve Google puzzle
	{first 10-digit prime found in consecutive digits of e}.com
so I needed a test for primality)

I have implemented Algorithm P, probabilistic primality test,
from Knuth, Donald E. 'The Art of Computer Programming', Vol 2,
Third Edition, section 4.5.4, page 395

Hope it helps
Bye
 <<IntegerPrimalityTesting.1.cs>> 
---
Enrico Spinielli                          Eurocontrol
mailto:enrico.spinielli at eurocontrol.int   Rue de la Fusée, 96
tel:+32-2-7299716                         B-1130 Bruxelles
fax:+32-2-7299022                         Belgium


____

This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IntegerPrimalityTesting.1.cs
Type: application/octet-stream
Size: 1730 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050601/a6c5b766/IntegerPrimalityTesting.1.obj


More information about the Squeak-dev mailing list