Description
The Precision.compareTo class was fixed in NUMBERS-154 to allow correct handling of NaN values. This fixed was applied to the compareTo with a delta but not compareTo using a max ULP argument.
This can be fixed by using Double.compare (as is done in compareTo(double, double, double):
public static int compareTo(final double x, final double y, final int maxUlps) { if (equals(x, y, maxUlps)) { return 0; } else if (x < y) { return -1; } else if (x > y) { return 1; } // NaN input. return Double.compare(x, y); }
Attachments
Issue Links
- is related to
-
NUMBERS-154 Consistent sorting using "Precision" class
- Closed