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

"BigFraction(double)" is unnecessary

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Done
    • None
    • 1.0-beta1
    • fraction
    • None

    Description

      Constructor BigFraction(double value) is only called from the from(double value) method.
      Actually, this constructor is misleading as it is indeed primarily a conversion from which appropriate numerator and denominator fields are computed; those could be set by
      the "direct" constructor BigFraction(BigInteger num, BigInteger den).

      Moreover, the private field ZERO goes through this conversion code whereas it could constructed "directly", e.g. using of(0). Similarly for field ONE.

      Attachments

        1. NUMBERS-123__Javadoc.patch
          1 kB
          Heinrich Bohne

        Issue Links

          Activity

            People

              erans Gilles Sadowski
              erans Gilles Sadowski
              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