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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • Operating System: Linux
      Platform: All

    • 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

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

            Dates

              Created:
              Updated:
              Resolved: