@Test public void testFloatComparisonSpecialValues() { assertEquals(0, NumberOperations.compare(Float.NaN, Float.NaN)); assertEquals(1, NumberOperations.compare(Float.NaN, Float.POSITIVE_INFINITY)); assertEquals(-1, NumberOperations.compare(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY)); }
public static int compare(Number n1, Number n2) { return (int)Math.round(calculate(OpType.COMPARE, n1, n2).doubleValue()); }
NumberOperations { public static int compare(Number n1, Number n2) { return (int)Math.round(calculate(OpType.COMPARE, n1, n2).doubleValue()); } }
NumberOperations { public static int compare(Number n1, Number n2) { return (int)Math.round(calculate(OpType.COMPARE, n1, n2).doubleValue()); }  }
NumberOperations { public static int compare(Number n1, Number n2) { return (int)Math.round(calculate(OpType.COMPARE, n1, n2).doubleValue()); }  static Number add(Number n1, Number n2); static Number subtract(Number n1, Number n2); static Number multiply(Number n1, Number n2); static Number divide(Number n1, Number n2); static int compare(Number n1, Number n2); static float getFloatTolerance(); static void setFloatTolerance(float tol); static double getDoubleTolerance(); static void setFloatTolerance(double tol); static int intValue(Number number); static long longValue(Number number); static float floatValue(Number number); static double doubleValue(Number number); static Number copy(Number number); static Number newInstance(Number number, Class<? extends Number> clazz); static Number castNumber(Number number, Class<? extends Number> clazz); static Class<? extends Number> highestClass(Number ...numbers); static Class<? extends Number> lowestClass(Number ...numbers); }
NumberOperations { public static int compare(Number n1, Number n2) { return (int)Math.round(calculate(OpType.COMPARE, n1, n2).doubleValue()); }  static Number add(Number n1, Number n2); static Number subtract(Number n1, Number n2); static Number multiply(Number n1, Number n2); static Number divide(Number n1, Number n2); static int compare(Number n1, Number n2); static float getFloatTolerance(); static void setFloatTolerance(float tol); static double getDoubleTolerance(); static void setFloatTolerance(double tol); static int intValue(Number number); static long longValue(Number number); static float floatValue(Number number); static double doubleValue(Number number); static Number copy(Number number); static Number newInstance(Number number, Class<? extends Number> clazz); static Number castNumber(Number number, Class<? extends Number> clazz); static Class<? extends Number> highestClass(Number ...numbers); static Class<? extends Number> lowestClass(Number ...numbers); static final float DEFAULT_FLOAT_TOL; static final double DEFAULT_DOUBLE_TOL; }