Division by zero: int vs. float

后端 未结 6 434
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-16 05:18

Dividing an int by zero, will throw an exception, but a float won\'t - at least in Java. Why does a float have additional NaN info, while an int type doesn\'t?

6条回答
  •  一生所求
    2021-01-16 05:44

    A clear Explanation about float arithmetic is given here

    http://www.artima.com/underthehood/floatingP.html

提交回复
热议问题