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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.