commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject Re: [math] StatUtils handling of zero length arrays - MATH-373
Date Thu, 10 Jun 2010 10:27:51 GMT
Bill Barker wrote:
> Currently StatUtils.sum(double [])  (as well as most other statistics
> that operate on arrays) returns NaN on a zero length array.  As pointed
> out in the Jira issue, this is not the conventional treatment of a
> summation over the empty set (which would return zero) in the
> mathematical world.  I would definitely want to change this in 3.0.  But
> I'm on the fence for how much of an incompatible change this would be
> for 2.2.
> The change is simple, and I'm volunteering to do the work.  I just
> wanted to ping the list for opinions on how much breakage we can allow
> in 2.2.

Unfortunately, I agree with Sebb that the behavior is documented and
changing it is a compatibility break, which we should not do in a .x
release.  There are probably other cases where the current API
"wrongly" or at least in a debatable way returns NaNs or throws
Exceptions, etc.  My vote is to open tickets for these and fix
systematically in 3.0 (which does not have to be years off).  I
would rather see us take a full, end-to-end look at the API and fix
*all* the sins in 3.0 than push out a series of compatibility
breaking 2.x releases.

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

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

View raw message