[ENH][GOODIE] A Pi Calculator

David N. Smith (IBM) dnsmith at watson.ibm.com
Sun Sep 9 23:36:23 UTC 2001


All:

I ran into some old code and ported it to Squeak. It computes Pi to an arbitrary precision, but in practice 10,000 digits on a Mac PowerBook G3 is a lot. See the attachment for details.

This is not too terribly useful except as a benchmark of fast integers, and a demo. I've check the result with results found on the web and they match to 10,000 digits.

This was created on 3.0 but should not be release dependent; I've done a quick test on the latest 3.1beta and that seems to work fine. There are two new methods added to Integer, but they are optional and can be omitted, though they are not apt to clash with anything else.

Try '1000 digitsOfPiAsString' it should run in a second or so on a G3 PowerBook.

See the class comment for more details

Dave
-------------- next part --------------
Skipped content of type multipart/appledouble


More information about the Squeak-dev mailing list