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

[math] Correction to mathUtils to check for overflow in lcm()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: All

    • Bugzilla Id:
      35431

      Description

      The code for lcm should be changed to the following code to check for overflow
      during the multiplication.

      public static int lcm(int a, int b)

      { return Math.abs(mulAndCheck(a / gcd(a, b) , b)); }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              j.weimar@tu-bs.de Jörg Weimar
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: