commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22091] New: - Adding tolerance to double[] search methods in ArrayUtils
Date Sun, 03 Aug 2003 14:57:52 GMT
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);

Mime
View raw message