Before this topic fades to the next page....
Henry Wong wrote:
Larry Olson wrote:
System.out.println(0.0 / (-4.0));
Good. But there is no trick in that, right? i.e. it is assumed everyone understands that! May be that is the reason Sahil didn't include that in the posted code
Hint: The answer is something that behaves slightly different from zero.
The answer is negative zero. This value is slightly different from the normal zero...
http://en.wikipedia.org/wiki/Signed_zero
The sign is maintained, so if further math is done, such as it is used as the divisor to any positive dividend, the quotient is negative infinity.
Henry