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

Doc bug in floorMod()

    XMLWordPrintableJSON

Details

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

    Description

      The docs for floorDiv() and floorMod() (both the int & long methods) say things like:

      Finds q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b > 0.

      That latter clause is probably supposed to be "if b < 0" - this should be clarified since (AFAICT) the whole point of these functions is to change the behavior from native ops when b is negative, or maybe when a*b is negative, but I'm not really sure which.

      As an aside, it would be great to add similar methods when a is a float/double, because Java's mod/div operators support float/double types too.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kenahoo Ken Williams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: