Division by zero

May 26, 2008 by Michael

Just a quick reminder for myself:

int a = 0/0; // Throws ArithmeticException
double d1 = 0/0.0; // d1 is NaN
double d2 = 1/0.0; // d2 is Infinity
double d3 = -1/0.0; // d3 is -Infinity

Can cause some headache if things fall apart in the JDBC driver and not before. Grmpf.

No comments yet

Post a Comment

Your email is never published nor shared. Required fields are marked *