我试图弄清楚这一点:
double chiSquare = ((double)(hashtable.get(key).intValue()/noWords))/* * Math.log10((NO_DOCUMENTS/all.get(key)))*/;
if (key.equals("love")){
System.out.println(hashtable.get(key));
System.out.println(all.get(key));
System.out.println(noWords);
System.out.println(chiSquare);
System.out.println((double)1/841);
System.exit(0);
}
为什么打印 chiSquare,打印零,而打印 1/841 给出双精度值?哈希表是<String, Integer>