public static double idf(double totalDocs,double numTimesWordAppearedInADocument){
  return totalDocs > 0 ? Math.log10(totalDocs / numTimesWordAppearedInADocument) : 0;
}

public static double idf ( double totalDocs , double numTimesWordAppearedInADocument ) { return totalDocs > 0 ? Math . log10 ( totalDocs / numTimesWordAppearedInADocument ) : 0 ; }
inverse document frequency : the total docs divided by the number of times the word appeared in a document
