You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Eric Barnhill (JIRA)" <ji...@apache.org> on 2017/06/22 12:47:00 UTC

[jira] [Created] (NUMBERS-45) Removal of isNaN() and isInfinite() methods from Complex class

Eric Barnhill created NUMBERS-45:
------------------------------------

             Summary: Removal of isNaN() and isInfinite() methods from Complex class
                 Key: NUMBERS-45
                 URL: https://issues.apache.org/jira/browse/NUMBERS-45
             Project: Commons Numbers
          Issue Type: Improvement
    Affects Versions: 1.0
            Reporter: Eric Barnhill
            Priority: Minor
             Fix For: 1.0


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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)