KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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?
Tags (comma-separated)
Save Edits
Cancel