Follow-up Comment #3, patch #8052 (project pspp):

I must admit I was a bit confused about the definition of harmonic mean of
sets with non-positive values. Wikipedia gives the definition of harmonic mean
for positive real numbers. OpenOffice also produces errors with sets including
zeros and negatives.

WolframAlpha does calculations for sets such as {2, -2, 3} -> 9, and also {2,
-2, 0} -> 0, which should be handled as an exeption. In the Wikipedia
definition, harmonic mean should always be less or equal with arithmetic mean.
The zero handling in the Wolfram version is quite intuitive if you consider
the resistance of parallel resistors: if even one resistor is zero, the
circuit is equivalent of all-zero resistors in parallel.

There seems to be different types of implementations in applications. Which
one to follow?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8052>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
pspp-dev mailing list
pspp-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to