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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.1
    • 3.3
    • None
    • 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

        1. COMMONSMATH-996.patch
          3 kB
          Tim Allison

        Activity

          People

            Unassigned Unassigned
            tallison Tim Allison
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: