Fundamentals of Numerics
The aims of the laboratory are:
-
To compile and run the simple java programs described in lectures
-
To complete web page setup
-
To look at a particle system applet
The exercises are:
-
Firstly, go to
file:///usr/local/pkg/j2sdk/docs/index.html
and bookmark this page. Then scroll down to the
reference to the API, and follow the link.
-
During lectures you saw several small Java programs and their output.
Here we are going to run these and verify their outputs.
-
The programs are as follows:
-
Download the above three programs and compile and run them.
-
For
floattest, use the Java Documentation to try to determine to meaning
of all the bits in the bit string that is returned.
-
For
overunder, using the knowledge you gained above, try to explain the
bit patterns you wuld get just before you overflow, or underflow.
-
For
epstest, the notes shows that two numbers are required, and the first
is always 1.0. If you changed that number, how would that affect the
eps result?
-
Modify one of these programs to force all the remaining special conditions
mentioned on page 2-10 of the notes.
-
Look up the Java Documentation to find out how numeric exceptions are
handled, then modify
overunder to detect and handle over/under
flows with a print statement that says "Gotcha!!"
-
On Andrew's Computational
Science website you will find a particle system
applet. At this stage you will need to put a symlink to the
java plug-in in your ~/.mozilla directory to get
the Java plugin to work. Instructions in laboratory.
ronvs@cs.rmit.edu.au
Last modified: $Date: 2004/07/19 16:44:27 $