Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Operating System: other
Platform: Other
-
22091
Description
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);