Re: What is the behaviour of double / float primitive == comparison?
"Gregory A. Swarthout" <[email protected]>
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
>Carfield Yim wrote: > 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 ) Why ask us? Why not try it and find out? Greg =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com