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

Fraction specified with maxDenominator and a value very close to a simple fraction should not throw an overflow exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.3
    • Labels:
      None

      Description

      An overflow exception is thrown when a Fraction is initialized with a maxDenominator from a double that is very close to a simple
      fraction. For example:

      double d = 0.5000000001;
      Fraction f = new Fraction(d, 10);

      Patch with unit test on way.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tallison@apache.org Tim Allison
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: