|
From: <pl...@pi...> - 2012-10-06 10:27:15
|
On 10/04/12 16:37, Clement Law wrote: > One question I have is that the harmonic mean is not defined for > numbers less than or equal to 0. Should I have harmean4() return 0 in > these cases? > > I hope it's acceptable, I've never written a patch for any open source > software before. > > Clement Law If the value is not defined then it should probably return NaN rather than zero , which would be an incorrect result. Presumably physical data where this is the appropriate mean would only go zero or negative if there was an error in the data. I can see that this mean would be a useful addition. Thanks, Peter. |