commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: DO NOT REPLY [Bug 37019] - [math] NaN handling in StatsUtil.min, StatsUtil.max methods
Date Fri, 14 Oct 2005 03:38:58 GMT
This should be discussed in a separate ticket against the Complex
class (done now - 37086).

The general policy in [math] is to use NaN consistently with floating
point arithemtic specs (IEEE 754 for real, C99x Annex G for complex
arithmetic) so for statistics such as Sum, Mean, etc. that involve
arithmetic computations, NaN values force the return value to be NaN.

The Min and Max order statistics ignore NaNs.  Slightly
inconsistently, the Percentile and Median order statistics use the
total ordering determined by Double.compareTo which considers NaN as
larger than any value (including Double.POSITIVE_INFINITY) and
consider NaNs in the computation.  All of this is specified in the
javadoc for these statistics.

Phil

>
> ------- Additional Comments From elharo@metalab.unc.edu  2005-10-13 16:45 -------
> The Complex class also has some questionable and undocumented behavior with
> respect to NaN (and Inf). It might be worthwhile considering on a general NaN
> policy for the math classes.
>
> --

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message