For your convenience and fun, the sample apfloat applets for an arbitrary precision calculator and a program for calculating pi are provided here.
- Pi calculator applet - Calculate a million digits of pi (or much more!)
- Calculator applet - Arbitrary precision calculator
There are some prerequisites to get them to run:
- You must have a Java 5 plugin or later. Many new computers have this already installed. If you don't have it, just get it from java.com.
- Set the Java plug-in to be the default for your browser. This usually happens automatically when installing the plugin but if not, you can do it from the Control Panel.
Tips for advanced users
- Unsigned applets are provided, but their calculation capabilities are limited by the available memory in your computer. You can be assured that these applets are safe to run, since the Java plugin will prevent the applets from doing anything potentially unsafe, like accessing your computer's file system.
- Alternatively, signed applets are also provided, which can use the full power of apfloat for calculations. They will need to create some temporary files on your disk. When you run these applets, they will display a security warning about an untrusted certificate. The certificate needs to be accepted to allow the program to run. The signed applets are equivalent to the command-line versions of the apfloat calculation programs, should you choose to download and run them instead.
- The pi calculation program is multi-threaded and can utilize all processors on your computer. In most cases the number of processors is detected properly but if your CPUs can run multiple hardware threads per core (e.g. Intel's Hyper-Threading or Sun's CoolThreads) then you can try to adjust the number of threads for maximum performance.
- By default, Sun's Java plugin uses the client VM on most computers. You can use the
server VM and get a free, roughly 40% performance boost. To do this, first download
the latest Java SDK
and install it. Then run e.g. the command:
appletviewer -J-server http://www.apfloat.org/apfloat_java/applet/pi.html
- For more advanced users, the downloadable package includes a distributed pi calculation program that can use multiple computers to calculate pi. This is the most powerful version of the pi calculation program available, but you need to download and set it up manually.