Lately I've written a project in Java and noticed a very strange feature with double/Double implementation. The double type in Java has two 0's, i.e. 0.0 and -0.0 (signed zero's). The strange thing is that:

0.0 == -0.0

evaluates to true, but:

new Double(0.0).equals(new Double(-0.0))

evaluates to false. Does anyone know the reason behind this?

Edit
Report