commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Ersoy <ole.er...@gmail.com>
Subject [math] RealVector.isInfinite() mixes in Nan check?
Date Sat, 26 Dec 2015 16:21:30 GMT
In RealVector there is an isInfinite() method that checks for isInfinite() and isNan() at the
same time.  If any coordinate is infinite, it will return true...unless a value is Nan...then
it will return false.  I'm probably missing something...but it seems like isInfinite() should
return true if the 'isInfinite' condition matches, without the check for Nan mixed in?  There
exists a method that checks for Nan as well.  I pasted both below:

     /**
      * Check whether any coordinate of this vector is {@code NaN}.
      *
      * @return {@code true} if any coordinate of this vector is {@code NaN},
      *         {@code false} otherwise.
      */
     public abstract boolean isNaN();

     /**
      * Check whether any coordinate of this vector is infinite and none are
      * {@code NaN}.
      *
      * @return {@code true} if any coordinate of this vector is infinite and
      *         none are {@code NaN}, {@code false} otherwise.
      */
     public abstract boolean isInfinite();

Thoughts?

Cheers,
Ole

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message