You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/08/03 16:57:52 UTC

DO NOT REPLY [Bug 22091] New: - Adding tolerance to double[] search methods in ArrayUtils

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22091>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22091

Adding tolerance to double[] search methods in ArrayUtils

           Summary: Adding tolerance to double[] search methods in
                    ArrayUtils
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: tobrien@discursive.com


It is sometimes useful to for the presence of a double within a given tolerance.
 For example, does this double[] array contain 3.054 +/- 0.001?

The patch attached adds new methods which use the DoubleRange test elements of
an array:

ArrayUtils.indexOf(double[] array, double valueToFind, double tolerance)

ArrayUtils.indexOf(double[] array, double valueToFind, int startIndex, double
tolerance);

ArrayUtils.lastIndexOf(double[] array, double valueToFind, int startIndex,
double tolerance);

ArrayUtils.contains(double[] array, double valueToFind, double tolerance);