wood burning stoves 2.0*
The moose likes Mock Exam Errata and the fly likes majji's question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "majji Watch "majji New topic
Author

majji's question

Malli Murugan
Greenhorn

Joined: Jul 09, 2001
Posts: 12
Hi,
System.out.println(Math.min(-0.0,+0.0) == Math.max(0.0,+0.0));
The answer is true;
How?
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Malli,
The == operator treats +0.0 and -0.0 as 0.0, it doesn't recognize the difference. See JLS §15.21.1
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Malli Murugan
Greenhorn

Joined: Jul 09, 2001
Posts: 12
Thanks Jane.
Malli
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: majji's question