Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6282196

There should be Math.mod(number, modulo) methods

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 5.0, 6
    • Fix Version/s: 8
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b65
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Description

      A DESCRIPTION OF THE REQUEST :
      It is sufficiently tricky to do modulo arithmetic on negative integers that methods should be provided in the Math class to do this correctly.

      JUSTIFICATION :
      A common mistake is to do Math.abs(n) % MODULO. If there were methods in the library that would do it right, these bugs could be more easily avoided. I note that BigInteger has a mod() method (presumably for efficiency).
      ###@###.### 2005-06-08 06:41:24 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rriggs Roger Riggs
                Reporter:
                jssunw Jitender S (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: