Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1259

Negative max in class Incrementor

Rank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersConvert to sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.0, 3.6
    • None
    • None

    Description

      In class Incrementor in the org.apache.commons.math4.util package it is possible to pass a negative number for the max variable. Given that the count variable is initialised to 0 by default, it means that canIncrement() method will always return false.

      I wonder whether it is an acceptable behaviour, given that documentation says that Incrementor is a utility that increments a counter until a maximum is reached. And in the case of negative max this maximum is not reachable at all.

      Attachments

        Issue Links

        Activity

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

          People

            Unassigned Unassigned
            gjahanagirova Gunel Jahangirova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment