[ https://issues.apache.org/jira/browse/NUMBERS-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074673#comment-16074673 ]
Eric Barnhill commented on NUMBERS-45: -------------------------------------- Sure, also for backwards compatibility maybe. The key was really to get them out of the methods where they "short circuit" many methods which return immediately if(isNaN()). > 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)