commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (O'brien, Tim)
Subject [math] exceptions or NaN from Univariate
Date Tue, 13 May 2003 22:55:57 GMT
Univariate getMean(), getVariance(), and getStandardDeviation() all
contain a note to throw an exception if n = 0.  It should be noted that
getVariance() and getStandardDeviation() don't make sense until n = 2.

The mean of an empty set is not a number, and currently calling (new
Univariate("blah")).getMean() returns NaN.  I'm just wondering if
throwing an exception is worth the trouble?  Any thoughts?

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

View raw message