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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 5.0, 6
    • Component/s: core-libs
    • b65
    • x86
    • windows_xp
    • Verified

      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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: