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

Fraction - Allow zero denominator if numerator is also zero

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Labels:

      Description

      The Fraction constructor rejects a denominator of zero. However, while trying to parse some Strings generated by another program, I encountered a fraction "0/0". I would say that's ambiguous as to if that's valid, but some people would agree the answer is zero.

      So, would it be possible to allow a zero denominator if the numerator is also zero. I'd be happy to provide a patch.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bramp Andrew Brampton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: