Sample Apfloat Applets
For your convenience and fun, the sample apfloat applets for an arbitrary
precision calculator and a program for calculating pi are provided right
here.
Arbitrary precision calculator applet
Unsigned
Signed
Pi calculation applet
Single-thread Unsigned
Signed
Multi-thread Unsigned
Signed
There are some prerequisites to get them to run:
- You must have a Java 5.0 plugin or later. The Java Virtual Machine
built-in to older versions of Internet Explorer and Netscape Navigator
is not sufficient (they only support Java 1.1.x, which is too old).
Get the plugin from
the Java website or from Sun.
Note that some new computers may already have the appropriate Java
plugin installed.
- Set the Java plug-in to be the default for your browser. You can do this
either when installing the plugin or later from the Control Panel.
- 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.
- Also, signed applets are 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. Even the certificate
is bogus; it's just a dummy certificate that isn't certified by any trusted
authority. It's up to you to allow or prevent the applets from running...
anyway the only unsafe thing they do is write temporary files to your disk.
It's not any more unsafe than the command-line version of the apfloat
calculation programs, if you would choose to download and run them instead.
- Both single-thread and multi-thread versions of the pi calculation
applet are provided. The multi-thread version provides an advantage only
if your computer has more than one processor. If you don't know how many
processors your computer has, it probably has just one, and you should then
use the single-thread version.
Tips for advanced users
- By default, Sun's Java plugin uses the client VM. 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.
Back to the apfloat for Java home page.
Last updated: January 5th, 2006