Why should the following code in Java
System.out.println(new Integer(1)/ new Double(0));
print 'Infinity' and not undefined. Isn't that mathematically wrong?
This is consistent with the IEEE 754 standard on floating-point, which Java follows.
2.1m questions
2.1m answers
60 comments
57.0k users