I just got the RHE Java2 Certification study guide. I was surprised to see that a double divided by 0 is equal to Double.NEGATIVE_INFINITY. All other books I had read said that a double divided by 0 was equal to Double.NaN. Now I am curious. What sort of operation would result in Double.NaN?
posted 15 years ago
Hi, Try System.out.println(Math.sqrt(-1.0)); Note that it does not throw any exception.