equals(Object o) and hashCode() for doubles functions