@steve
For those confused about NaN in the responses. NaN is not a number. One may get a NaN by 0/0 while 1/0 is infinity.
http://perso.ens-lyon.fr/jean-michel.muller/goldberg.pdf
What Every Computer Scientist Should Know About
Floating-Point Arithmetic
DAVID GOLDBERG