Hello, In the MathUtils class, there are a few assert statements. Most of them are commented out, except the two following ones:
public static boolean equals(float x, float y, int maxUlps) { // Check that "maxUlps" is non-negative and small enough so that // NaN won't compare as equal to anything (except another NaN). assert maxUlps > 0 && maxUlps < NAN_GAP; ... } public static boolean equals(double x, double y, int maxUlps) { // Check that "maxUlps" is non-negative and small enough so that // NaN won't compare as equal to anything (except another NaN). assert maxUlps > 0 && maxUlps < NAN_GAP; ... } Since asserts are often not enabled, these assers are no-op. They also are somewhat misleading since setting maxUlps to 0 is in fact possible and produces in correct results: it means we do an exact comparison and should be allowed. I propose to change the "maxUlps > 0" into "maxUlps >= 0" and either 1) comment out the corresponding asserts (just as the other ones in the file are commented out) 2) replace the asserts by a real test and throw a MathIllegalArgumentException 3) remove the asserts without replacement I would prefer choice 1. What do you think ? Luc --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org