Uploaded image for project: 'Commons Numbers'
  1. Commons Numbers
  2. NUMBERS-122

Helper assertion methods in BigFractionTest not strict enough

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0
    • 1.0-beta1
    • fraction
    • None

    Description

      The helper methods assertFraction(int, int, BigFraction) and assertFraction(long, long, BigFraction) don't check whether the numerator and denominator of the BigFraction are equivalent to the first two arguments. Rather, they check whether the numerator and denominator truncated to an int or long are equal to the first two arguments. This is unsatisfactory and also probably not in the spirit of the creator of these methods.

      Also, the method assertFraction(int, int, BigFraction) is redundant, because an int can be cast to a long without loss of precision, so assertFraction(long, long, BigFraction) is sufficient to handle both int and long arguments.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Schamschi Heinrich Bohne
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h