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

BigFraction.doubleValue() returns Double.NaN for large numerators or denominators

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 3.0
    • None
    • None

    Description

      The current implementation of doubleValue() divides numerator.doubleValue() / denominator.doubleValue(). BigInteger.doubleValue() fails for any number greater than Double.MAX_VALUE. So if the user has 308-digit numerator or denominator, the resulting quotient fails, even in cases where the result would be well inside Double's range.

      I have a patch to fix it, if I can figure out how to attach it here I will.

      Attachments

        1. src.patch
          3 kB
          Thundre

        Activity

          People

            Unassigned Unassigned
            thundre Thundre
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: