What is the behaviour of double / float primitive == comparison?
Carfield Yim <[email protected]>
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
I am not really clear about the definition of JLS: Otherwise, two distinct floating-point values are considered unequal by the equality operators. In particular, there is one value representing positive infinity and one value representing negative infinity; each compares equal only to itself, and each compares unequal to all other values. http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#5198 Say for following case, will this print true? System.out.println( 3.0/7.0 == 1.5/3.5 ) =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com