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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 3.0
    • Labels:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: