public static boolean isValid(double dbl){
  return !Double.isNaN(dbl) && !Double.isInfinite(dbl);
}

public static boolean isValid ( double dbl ) { return ! Double . isNaN ( dbl ) && ! Double . isInfinite ( dbl ) ; }
checks if number is valid ( not infinity or nan )
