Top Architect
Feb 18, 2022 · Backend Development
Understanding Java Float -0.0 and hashCode: Why 0.0 and -0.0 Behave Differently in Maps
This article explains why Java's Float values 0.0 and -0.0 have different hashCode results, how that affects their use as Map keys, and demonstrates the underlying IEEE‑754 representation and related debugging steps with concrete code examples.
HashCodefloatieee754
0 likes · 9 min read