I was thinking of using a Double as the key to a HashMap but I know floating point comparisons are unsafe, that got me thinking. Is the equals method on the Double class als
It depends on how you store and access you map, yes similar values could end up being slightly different and therefore not hash to the same value.
private static final double key1 = 1.1+1.3-1.6;
private static final double key2 = 123321;
...
map.get(key1);
would be all good, however
map.put(1.1+2.3, value);
...
map.get(5.0 - 1.6);
would be dangerous
Maybe BigDecimal get you where you want to go?