jQuery in Action, 3rd edition
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "majji Watch "majji New topic

majji's question

Malli Murugan

Joined: Jul 09, 2001
Posts: 12
System.out.println(Math.min(-0.0,+0.0) == Math.max(0.0,+0.0));
The answer is true;
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

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