jscience
  1. jscience
  2. JSCIENCE-140

JSR-275 - Missing unit argument in Measure.approximate

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: Version 6.0
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      140

      Description

      This is actually a JSR-275 issue (temporary stored here).
      To be consistent the Measure.approximate should specify the epsilon unit.
      Also, seems better to use standard equals method with additional parameters
      rather than a new name.

      /**

      • Compares this measure and the specified measurable to the given accuracy.
      • Measurements are considered approximately equals if their absolute
      • differences when stated in the same specified unit is less than the
      • specified epsilon.
        *
        *
      • @param that the measurable to compare with.
      • @param epsilon the absolute error allowed stated in epsilon unit.
      • @param epsilonUnit the epsilon unit.
      • @return <code>abs(this.doubleValue(epsilonUnit)-
        that.doubleValue(epsilonUnit)) <= epsilon</code>
        */
        public boolean equals(Measurable<Q> that, double epsilon, Unit epsilonUnit) { return Math.abs(this.doubleValue(epsilonUnit) - that.doubleValue(epsilonUnit)) <= epsilon; }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jscience-issues
            Reporter:
            dautelle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: