From 4cbb775abba882e5f43bb1014634cccd69c94987 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Tue, 16 Jul 2013 09:35:54 +0000 Subject: [PATCH] Javadoc clarifications git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1503631 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/math3/stat/Frequency.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/math3/stat/Frequency.java b/src/main/java/org/apache/commons/math3/stat/Frequency.java index 19423051e..d9d7506c5 100644 --- a/src/main/java/org/apache/commons/math3/stat/Frequency.java +++ b/src/main/java/org/apache/commons/math3/stat/Frequency.java @@ -48,6 +48,12 @@ import org.apache.commons.math3.util.MathUtils; * to combine integral types with chars in a frequency distribution will fail. *

*

+ * Float is not coerced to Double. + * Since they are not Comparable with each other the user must do any necessary coercion. + * Float.NaN and Double.NaN are not treated specially; they may occur in input and will + * occur in output if appropriate. + * + *

* The values are ordered using the default (natural order), unless a * Comparator is supplied in the constructor.

* @@ -301,7 +307,9 @@ public class Frequency implements Serializable { * Returns the percentage of values that are equal to v * (as a proportion between 0 and 1). *

- * Returns Double.NaN if no values have been added.

+ * Returns Double.NaN if no values have been added. + * Returns 0 if at least one value has been added, but v is not comparable + * to the values set.

* * @param v the value to lookup * @return the proportion of values equal to v