Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-70

Adding tolerance to double[] search methods in ArrayUtils

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • 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);

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tobrien@discursive.com Tim O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment