commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject [math] Shoud OpenIntToDoubleHashMap get return NaN instead of 0 for key not found?
Date Fri, 02 Jan 2009 14:44:04 GMT
I am still working through this class and the sparse matrix class that 
it was extracted from (thanks, Ismael and Sugit!), so I am not sure if 
changing this would cause problems, but the current setup (returning 0 
for missing keys) limits usefulness of this class.   I see how this is 
convenient for sparse matrices; but I would see NaN as a more natural 
return value for non-existent keys in the general case.  Alternatively,  
I guess we could add another method get(int key, double missingReturn).



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message