title: Can I force java to throw an error when dividing by zero with floating point numbers?
body: <p>I wrote a simulator that has some collision detection code and does a good bit of math on each object when it detects collisions. </p>
  
  <p>If these two objects are at the exact same location or in some rare other cases, I'm getting NaN (not a number) as their location somewhere along the line and I'd like to know where.  Normally, the program would crash if I did these operations on integers but because + and - infinity are part of the floating point spec, it is allowed.</p>
  
  <p>So, somewhere along the line I'm taking a square root of a negative number or dividing by zero.</p>
  
  <p>Is there anyway I can make my program automatically crash on the operations that cause this so I can narrow it down some?</p>