public static boolean compareCellValue(Double v1,Double v2,double t,boolean ignoreNaN){
  if (v1 == null)   v1=0.0;
  if (v2 == null)   v2=0.0;
  if (ignoreNaN && (v1.isNaN() || v1.isInfinite() || v2.isNaN()|| v2.isInfinite()))   return true;
  if (v1.equals(v2))   return true;
  return Math.abs(v1 - v2) <= t;
}

public static boolean compareCellValue ( Double v1 , Double v2 , double t , boolean ignoreNaN ) { if ( v1 == null ) v1 = 0.0 ; if ( v2 == null ) v2 = 0.0 ; if ( ignoreNaN && ( v1 . isNaN ( ) || v1 . isInfinite ( ) || v2 . isNaN ( ) || v2 . isInfinite ( ) ) ) return true ; if ( v1 . equals ( v2 ) ) return true ; return Math . abs ( v1 - v2 ) <= t ; }
compares two double values regarding tolerance t . if one or both of them is null it is converted to 0 . 0 .
