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

Removal of isNaN() and isInfinite() methods from Complex class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0
    • 1.0-beta1
    • complex
    • None

    Description

      Complex() currently contains the methods isNaN() and isInfinite() which return positive when either the real or the imaginary components of the Complex number are infinite. They are principally used as a "short circuit" in many of the methods, that is, isNaN() is checked and if true, Complex.NaN is returned without further processing.

      isNaN() and isInfinite() should be removed from Complex. For the purposes of ISO C standards, nearly all methods need to handle arguments and return values in which either real or imaginary is NaN or Infinite, but not both. Thus this quick "sanity check" prevents Commons from complying with ISO C standards.

      It is easy enough to check whether the fields Complex.real and Complex.imaginary with Double.isNaN() or Double.isInfinite() if comparison is desired.

      These methods then need to be removed from certain tests in ComplexTest which call the isNaN() or isInfinite() methods. Most of these methods are superseded by the new C standard tests anyway.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ericbarnhill Eric Barnhill
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: