Double division behaving wrongly

后端 未结 4 1262
旧巷少年郎
旧巷少年郎 2020-11-30 15:51

I have a HashMap called List wordFreqMap whose size is 234

wordFreqMap = {radiology         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 16:22

    You are doing integer division and then casting that answer to a double. What you need to do is cast one of the two values to a double first, and then do division on it. That should get you the answer you desire.

提交回复
热议问题