title: Why doesn't Java throw an Exception when dividing by 0.0?
body: <p>I have code to calculate the percentage difference between 2 numbers - <code>(oldNum - newNum) / oldNum * 100;</code> - where both of the numbers are <code>double</code>s. I expected to have to add some sort of checking / exception handling in case oldNum is 0. However, when I did a test run with values of 0.0 for both oldNum and newNum, execution continued as if nothing had happened and no error was thrown. Running this code with <code>int</code>s would definitely cause an arithmetic division-by-zero exception. Why does Java ignore it when it comes to <code>double</code>s?</p>