public static double absoluteDifference(double a, double b) {
    if (Double.compare(a, b) == 0) {  // Shortcut: handles infinities and NaNs.
      return 0;
    } else {
      return Math.abs(a - b);
    }
  }
public static double absoluteDifference(double a, double b) {
    if (Double.compare(a, b) == 0) {  
      return 0;
    } else {
      return Math.abs(a - b);
    }
  }
public static double absoluteDifference ( double a , double b ) { if ( Double . compare ( a , b ) == 0 ) { // Shortcut: handles infinities and NaNs. return 0 ; } else { return Math . abs ( a - b ) ; } }
Same as {@link #absoluteDifference(float, float)}, but for doubles.
Same as {