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

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

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 8
    • 5.0, 6
    • core-libs
    • b65
    • x86
    • windows_xp
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: