I am adding a canEqual method in MathUtils since neither Math.equals nor Precision.equalsIncludingNaN performs better under heavy load (I have attached the test code for the same in the patch).
The reason as far as i can think is : In case of equals it keeps churning new objects and makes Double.equals and in case of Precision.equalsIncludingNaN it might be that it has not covered the case of quick elimination of detecting one of them as nan as in that case it can return false. The change i am bringing in is simple in that in any case of either of them nan or both then return true or false and if and only if both are *not nan* then get to Precision.equals Does any on have a concern adding this method or if the change needs to be done else where such as in Precision.equalsIncludingNaN Please opinionate. thanks venkat --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org