Is it safe when compare 2 float/double directly in Java?

后端 未结 9 997
刺人心
刺人心 2020-12-17 02:30

Is it safe if I use comparision like this (a is int, b and c is float/double):

a == b
b == c

It may hear ridiculous, but in my old programi

9条回答
  •  独厮守ぢ
    2020-12-17 02:54

    If you want a more complete explanation, here there is a good one: http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html (but it is a little bit long)

提交回复
热议问题