Assignment 6: Geo Float
Get the tar file geofloat.tar.gz which has
the geodesic files and the ieee stuff we were playing with. For the
IEEE floating point format see the links
html
pdf
- Use the geodesic code to get geodesic pictures for a couple of
other surfaces. The sphere x^2+y^2+y^2=3^2, or the elliptic paraboloid
z = x^2+y^2 or the monkey saddle z = x^3-3xy^2, or something else.
Try to make it prettier than what I did.
- If one writes one tenth as a float, is the value higher or lower that
one tenth. If you add one tenths over and over again n times is it always
smaller always larger than n/10.0? (write a program that checks your
reasoning.)
- I rewrote float.c and included an old machine.cc with machine.out
(from the code that is commented out.) Use the handout to figure out
what the binary representation of 5.5e5 and -5.5e-5 would be and use
one of these programs to check that you got the correct answer.
- Find a bitwise test for NaN. That is if you copy a float as a
string into an integer i, find a mask m so that (m & i) && !(~m & i)
is equivalent to the float being a NaN. (It might be slightly more
complex.)